home *** CD-ROM | disk | FTP | other *** search
/ Enigma Amiga Life 112 / EnigmaAmiga112CD.iso / dalla rivista / awnpipe / awnp / awnp-docs / awnpipe-docs.text < prev    next >
Text File  |  2000-05-18  |  176KB  |  6,079 lines

  1. ==============================================================================
  2.                                 AWNPipe - Docs                                
  3. ==============================================================================
  4.  
  5. Index:
  6. ======
  7.  
  8. 1 About
  9. 2 Read First
  10. 3 Pipe Functions
  11.   3.1 Overview
  12.   3.2 Conversion
  13.   3.3 Paths
  14.   3.4 Internal
  15.   3.5 Extensions
  16.   3.6 Tutorials
  17.       3.6.1 Simple
  18.       3.6.2 Advanced
  19.       3.6.3 Tricks
  20. 4 GUI Creation
  21.   4.1 Conversation
  22.       4.1.1 Basic
  23.       4.1.2 Step by Step
  24.       4.1.3 Details
  25.   4.2 Objects
  26.       4.2.1 Window
  27.       4.2.2 Simple Gadgets
  28.             4.2.2.1 Button
  29.             4.2.2.2 Integer
  30.             4.2.2.3 String
  31.             4.2.2.4 CheckBox
  32.             4.2.2.5 Chooser
  33.             4.2.2.6 RadioButton
  34.       4.2.3 Images
  35.             4.2.3.1 Label
  36.             4.2.3.2 Glyph
  37.             4.2.3.3 DrawList
  38.             4.2.3.4 PenMap
  39.             4.2.3.5 Bitmap
  40.             4.2.3.6 Image
  41.             4.2.3.7 Space
  42.       4.2.4 Special
  43.             4.2.4.1 Layout(End)
  44.             4.2.4.2 ClickTab
  45.             4.2.4.3 TextAttr
  46.             4.2.4.4 BrowserNode
  47.             4.2.4.5 Menu
  48.             4.2.4.6 Arexx
  49.       4.2.5 Fancy
  50.             4.2.5.1 GetFile
  51.             4.2.5.2 GetFont
  52.             4.2.5.3 TextEditor
  53.             4.2.5.4 TextFeild
  54.             4.2.5.5 ListBrowser
  55.             4.2.5.6 Palette
  56.       4.2.6 More
  57.             4.2.6.1 Fuelgauge
  58.             4.2.6.2 Scroller
  59.             4.2.6.3 Slider
  60.             4.2.6.4 WeightBar
  61.             4.2.6.5 Commodity
  62.   4.3 Events
  63.   4.4 Modify
  64.   4.5 GUI Tutorial
  65.       4.5.1 Design
  66.       4.5.2 Operation
  67.       4.5.3 Modification
  68.       4.5.4 Extras
  69.       4.5.5 Advanced
  70.       4.5.6 Tips
  71. 5 Demos
  72.  
  73.  
  74. ------------------------------------------------------------------------------
  75.                                    1 About                                    
  76. ------------------------------------------------------------------------------
  77.  
  78.      AWNPipe:   Multifunction Device
  79.      Author:    William H. M. Parker
  80.      Version:   2.48  19 May 2000
  81.  
  82.  AWNPipe is a new kind of ADOS device. It's functions can be accessed from 
  83. almost any program including C, E, Assembler, Arexx, and simple ADOS scripts. 
  84. AWNP has many uses but the most popular is the creation of Graphical User 
  85. Interfaces. Other functions include clipboard support, tooltype access, 
  86. pattern matching, Html conversion, data stream twinning, ...
  87. Programmers will find that GUI development is VERY fast using AWNP and 
  88. testing various layouts is as easy as editing a text file.
  89.  
  90. Programs written using AWNP present the user with a GUI that is easy to use 
  91. and consistent in form. The ease of adding menus, Arexx hosts, help 
  92. information and images encourages authors to add more of the 'Nice' features 
  93. to their programs.
  94.  
  95.   Distribution
  96.  
  97.  AWNPipe can be freely distributed in the form of this archive, complete and 
  98. unmodified.
  99.  
  100.  The operational parts (AWNPipe-handler and AWNPipe) may be included in the 
  101. distribution of programs using AWNPipe if the following three conditions are 
  102. met.
  103.  
  104. 1. The distribution contains an install script and the AWNPipe files are 
  105. handled as follows (NOTE the use of 'copylib' for awnpipe-handler).
  106.  
  107. (copylib
  108.   (source "device/awnpipe-handler")
  109.   (dest "l:")
  110.   (prompt "Installing AWNPipe-handler")
  111. )
  112. (copyfiles
  113.   (dest "Devs:dosdrivers")
  114.   (source "device/awnpipe")
  115.   (prompt "Installing AWNPipe")
  116.   (infos)
  117. )
  118. (working ("Activating AWNPipe:"))
  119. (run "C:assign AWNPipe: dismount")
  120. (run "C:mount AWNPipe:")
  121.  
  122. 2. The docs mention the use of AWNP and the version number of AWNPipe in the 
  123. distribution.
  124.  
  125. 3. The AWNPipe author is notified, bill@amitrix.com .
  126.  
  127. This software is CHILDWARE. I require whoever uses this program to make a 
  128. donation to a beneficial organization working to help children. If you don't 
  129. know of any, ask at your local post office and learn how to make a payment to 
  130. UNICEF. The amount is up to you, but please do it!
  131.  
  132. Requirements
  133.  
  134. AWNPipe requires ADOS 3.x
  135.  You must have Class Act installed or be using ADOS 3.5 to use the pipes GUI 
  136. building functions. Class Act can be found on Aminet, or use 
  137. http://www.amitrix.com/AWeb30ca.lha (the latter has been tested for 
  138. compatability with AWNPipe).
  139.  
  140. Support
  141.  
  142.  Support is currently available from :
  143.  
  144.  http://www.onelist.com/community/awnpipe
  145.  http://web.ukonline.co.uk/awnpipe/
  146.  or directly from the AWNP Author, bill@amitrix.com.
  147.  
  148. History
  149.  
  150. o AWNPipe-handler Vers 2.48
  151.   - added work around for disable of clicktabs
  152.   - added the ability to disable a single tab of a clicktab
  153.   - fixed docs, disable keyword description was backwards in some places
  154.   - '/m' multiple opens now work when reading data.
  155.   - added '/m' explanation to pipe functions/tutorials/tricks
  156.   - cleaned up docs in various places.
  157.   - added plain text version of these docs
  158.   - added Amiga Guide version of these docs
  159.   - fixed bug in XO.rx demo
  160.  
  161. o AWNPipe-handler Vers 2.47
  162.   - added '/xs' (seticon)  ability to write icon tooltypes, position, type, 
  163. and defaultool
  164.   - expanded tutorial5 to cover writing tooltypes
  165.   - GUI advanced doc has been expanded
  166.  
  167. o AWNPipe-handler Vers 2.46
  168.   - trailing '/' in no longer required in drawers only getfiles.
  169.   - fixed asl getfile loss of initial title
  170.   - fixed asl getfile missing space in event
  171.   - fixed asl getfile retention of pos and neg text
  172.   - worked around for missing refresh in multiselect listbrowser
  173.  
  174. o AWNPipe-handler Vers 2.45
  175.   - expanded drawlist commands (changed some directive values as well)
  176.   - corrected Browsernode and listbrowser docs
  177.   - added refresh ability to browsernodes
  178.   - fixed multiselect listbrowser bug
  179.  
  180. o AWNPipe-handler Vers 2.44
  181.   - fixed bug ScreenTitle could be trashed when setting WindowTitle.
  182.   - binary data for GUI is no longer limited to 10000 bytes
  183.   - added '/xt' option to query icon tooltypes
  184.   - fixed bug An extra 'ok' was returned when an addnode modify line included 
  185. sc=
  186.   - expanded readme file
  187.   - tutorial 5 now checks tool types of its icon
  188.   - Advanced GUI tutorial text updated
  189.   - Added sanity check, you can't force gadget refresh while window is 
  190. iconified
  191.   - The dictionary demo is now a thesaurus as well 
  192. (docs/demos/dict-thesar.rx)
  193.  
  194. o AWNPipe-handler Vers 2.43
  195.   - fixed return from commodity modify.
  196.   - Added underscore keyword to label image
  197.  
  198. o AWNPipe-handler Vers 2.42
  199.   - Added Commodity Object, see GUI Creation/Objects/More.
  200.   - Tutorial 5 is now a commodity.
  201.   - Tutorial 5 is now an arexx host.
  202.   - updated advanced gui tutorial docs.
  203.  
  204. o AWNPipe-handler Vers 2.41
  205.   - added order modify keyword to retrieve the order of nodes in a list 
  206. browser
  207.   - the CAList demo is now called GUIList and a short doc file added
  208.   - the FontToy demo has been updated and a short doc file added
  209.  
  210. o AWNPipe-handler Vers 2.40
  211.   - fixed bug in ASL getfile title modify
  212.   - added some important text to the getfile docs.
  213.   - fixed bug, GUI Host could hang on selection of invalid browsernode
  214.   - fixed bugs ASL getfile, height parameter, filename
  215.   - added function, removenode now works with list detached
  216.   - Listbrowsers can now be sorted by two fields at once.
  217.   - added option to set positive text is ASL getfile
  218.   - added option to set negative text is ASL getfile
  219.   - No more deadlocks when a read is pending on both ends of a pipe !!!
  220.   - refined help window size and placement
  221.  
  222. o AWNPipe-handler Vers 2.39
  223.  - added '/Xea' option to generate keystrokes from a simple ANSI source.
  224.  - fixed arexx host creation (could cause enforcer hits)
  225.  - changed fonttoy demo
  226.  
  227. o AWNPipe-handler Vers 2.38
  228.  - oops 2.37 has new 'beep' modify command to flash screen(s).
  229.  - added keystroke event generator.  '/Xe'
  230.  - added keystroke filter and notification '/Xk'
  231.  - optimized A4 initialization for faster handler.
  232.  
  233. o AWNPipe-handler Vers 2.37
  234.  - added 'bufferpos' to read cursor position in string gadgets.
  235.  - fixed bug, unmatched commands to an arexx host could cause software 
  236. failure.
  237.  - fixed cut and paste tutorial text in the docs.
  238.  - expanded tutorial 5 teaching about ARexx hosts.
  239.  - added sliders to gadgets 3 demo.
  240.  
  241. o AWNPipe-handler Vers 2.36
  242.  - started real history record
  243.  - added 'askclose' to window definition to stop window close button from 
  244. actually closing the window.
  245.  - added 'bubble' modify command to open a help bubble.
  246.  - added cursor position to help events.
  247.  - added 'ASL' option to getfile to use an ASL rather than ClassAct/Reaction 
  248. based requester.
  249.  - added work around for the fact CA/Reaction GetFile and GetFont can trash 
  250. the GUI when help events are enabled.
  251.  - added tutorial 5 teaching bubble help.
  252.  - added 'weightbar' gadget..
  253.  - 'label' and 'bitmap' now return the created image size.
  254.  
  255. o AWNPipe-handler Vers 2.33 and earlier
  256.  - added 'draw' modify command to draw images manually into GUI.
  257.  - added 'refresh' events to window to allow refreshing of manually drawn 
  258. images.
  259.  - added 'mouse' modify command to read mouse position.
  260.  - added 'slider' gadget type.
  261.  - added REAL menu bars.
  262.  - made menu mutilselect.
  263.  - extended appwindow support to allow dropping of a group of icons.
  264.  - added some 'C' based tutorials, anyone using awnp from 'C' please contact 
  265. the AWNP author.
  266.  - added unit number option to '/v' and '/c' reading and writing the 
  267. clipboard.
  268.  - fixed bug in modification of scroller gadgets.
  269.  - added a bunch of new modify commands for list browsers.
  270.  - added command to read the  contents aof a list node.
  271.  - added 'TextEditor' gadget type.
  272.  
  273. Origin
  274.  
  275.  AWNPipe was originally developed as a way to speed up the execution of my 
  276. ARexx script AWebNews.awebrx. As I continued writing scripts I added more and 
  277. more functions to the pipe. Some of the functions have proven useful to 
  278. others writing Amiga prpgrams. I built these docs in the hope that AWNPipe: 
  279. will be of use to Amiga programmers in general.
  280.  
  281. Acknowledgements
  282.  
  283.  I would like to thank Gabriele Favrin (author of HTTX) for his input, 
  284. testing and constant encouragement while writing AWNPipe.
  285.  
  286.  I also thank...
  287.  
  288.  Bruce Steers for maintaining the AWNP support page and finding many subtle 
  289. bugs.
  290.  
  291.  Nils Goers for his testing under ADOS 3.5 and developing his wonderful 
  292. program T.H.E. using AWNP, as well as his bug reports.
  293.  
  294.  Bernd Gollesch for writing the script that creates the Amiga Guide and plain
  295. text versions of the docs automagicaly.
  296.  
  297. Everyone else who provided bug reports or feed back helping me make AWNP 
  298. better.
  299.  
  300. Bill
  301.  
  302. ------------------------------------------------------------------------------
  303.                                  2 Read First                                 
  304. ------------------------------------------------------------------------------
  305.  
  306.  AWNPipe itself is stable and quite well tested. These docs are still a work 
  307. in progress so please excuse typos and omissions.
  308.  
  309.  At first glance AWNPipe may appear complex. Actually each of the functions 
  310. in the pipe are simple to use when taken individually. Don't try to learn 
  311. everything at once, pick a single function and try it out. Each function can 
  312. be used without knowing anything about the other functions.
  313.  
  314.  Most of you will be primarily interested in building and operating GUI's. 
  315. You can go directly to the GUI Creation section and start there. The 
  316. important part to read about is the conversation, then try the tutorials in 
  317. that section.
  318.  
  319.  To learn about pipe functions go straight to Pipe Functions/Tutorials/Simple 
  320. and work through the examples.
  321.  
  322.  Right Amiga C can be used to cut and paste example text from the docs. This 
  323. helps to avoid typos.
  324.  
  325. Feel free to contact me, <bill@amitrix.com>, with your questions and 
  326. comments.
  327.  
  328.  Have Fun !
  329.  
  330. ------------------------------------------------------------------------------
  331.                                3 Pipe Functions                               
  332. ------------------------------------------------------------------------------
  333.  
  334.  
  335. ------------------------------------------------------------------------------
  336.                                  3.1 Overview                                 
  337. ------------------------------------------------------------------------------
  338.  
  339.  The pipe function sections are NOT required reading to learn how to build 
  340. GUI's.
  341.  
  342.  Using AWNPipe
  343.  -------------
  344.  
  345. All of AWNPipes functions are accessed through a pipe like interface as the 
  346. name implies. Pipes are accessed like any other type of file using open, 
  347. close, read, and write. From Amiga DOS a pipe can be used almost any place 
  348. you would normally use a file name.
  349.  
  350. The name of each pipe starts with the device name 'awnpipe:'. This is 
  351. followed by a unique name that is used to identify the pipe. The name MAY 
  352. also be followed by a '/' and some option information to give the pipe 
  353. special abilities. 'awnpipe:myfile' and 'awnpipe:test' are examples of pipe 
  354. names.
  355.  
  356. The options after the '/' usually cause the data to be altered as it passes 
  357. into the pipe. Then data you read out from the pipe will be different than 
  358. the data you wrote into it. The '/h' function works this way, any '&' written 
  359. into the pipe will be read back as '&'.
  360.  
  361. Some other options connect the pipe to special hosts like the clipboard. Data 
  362. written to a pipe ending in '/c0' goes into the clipboard unit 0. The data 
  363. read from a pipe ending in '/v0' will be the contents of clipboard unit 0.
  364.  
  365. Here is a simple example showing data going in and out of a pipe.
  366.  
  367. echo "hello World" > AWNPipe:test
  368. type AWNPipe:test
  369.  
  370.  
  371. This following information is intended as a reference for people already 
  372. familiar with AWNP. To learn how to use pipe functions work through the 
  373. tutorials.
  374.  
  375.  Pipe Types
  376.  ----------
  377.  
  378. /I immediate   /U unHTML        /E execute    /L link
  379. /R read        /P Postaweb      /O <option>   /V[unit#] readclip
  380. /W write       /! do not wait   /B backwards  /C[unit#] writeclip
  381. /H HTML        /T tap           /F force      /S status
  382. /G HTML2       /A Abort         /-vers# minimum version
  383. /@ seek enable /M Multiple Opens   /1 open first end
  384.  
  385. /x[option] extra function
  386.       /xc open interactive Class Act pipe
  387.       /xcr[filename] open interactive Class Act pipe, reading the window and 
  388. gadget definitions from a separate file.
  389.       /xcw[filename] open interactive Class Act window, writing the events to 
  390. a separate file.(also sets immediate and force)
  391.       /xm[c]    string pattern match c=case sensitive
  392.       /xm[c]w    string pattern match c=case sensitive results to separate 
  393. file
  394.       /xm[c]r    string pattern match c=case sensitive reading data from 
  395. separate file. (also sets immediate and force)
  396.       /x0 programmable replace loopback
  397.       /x0r[filename] programmable replace from file
  398.       /x0w[filename] programmable replace to file
  399.       /xk remove keystrokes from input event stream and notify
  400.       /xe write keystrokes to the input event stream from code & qual
  401.       /xea write keystrokes to the input event stream from ANSI source
  402.       /xt[filename] query icon tooltypes
  403.       /xi[filename] read tooltype information for a file.
  404.  
  405. Details about AWNPipe
  406. ---------------------
  407.  
  408. AWNPipe:test/h AWNPipe:test AWNPipe:test/h/f/rhelpme are all the same file. 
  409. The unique name terminates on the first '/' or the end of the name if no '/' 
  410. is found. '%' may be substituted for  '/' .
  411.  
  412. A pipe name is usually only opened twice. After that calls to open will fail. 
  413. After both ends of the pipe are closed the pipe name can  be used again. A 
  414. pipe can immediately be written after it is opened, even if the other end has 
  415. not yet been opened. Some special options can override this behavior.
  416.  
  417. Some types of pipes are only opened ONCE. The second end of these pipes are 
  418. automatically connected to something by the AWNPipe internal code. Clipboard 
  419. access is an example of this type of pipe.
  420.  
  421. All file handles can both read or write data. A check is made to see if pipes 
  422. dead lock from pending reads on both ends. If this happens both of the 
  423. pending reads are aborted to break the deadlock.
  424.  
  425. Data flow is never stopped by buffering.
  426.  
  427. If data is written into a pipe and the second end never opened, the pipe 
  428. stores all written data.... forever  (until you reboot).
  429.  
  430.  
  431.  
  432. ------------------------------------------------------------------------------
  433.                                 3.2 Conversion                                
  434. ------------------------------------------------------------------------------
  435.  
  436. Data Conversion
  437. ----------------
  438.  
  439. The data passing through the pipe may be modified by the pipe with the 
  440. following options.
  441.  
  442. H option
  443. ========
  444.  
  445. html conversion - some special characters are translated into html tokens.
  446. & > <  become & < >
  447. This option must be specified on the file handle that is written.
  448.  
  449. copy ram:test AWNPipe:test/h
  450. copy AWNPipe:test ram:test2
  451.  
  452.  
  453. G option
  454. ========
  455.  
  456. The same as the H option above, except that any special html character 
  457. preceded by an '@' is not converted. The preceding '@' is removed during the 
  458. translation process.
  459.  
  460. U option
  461. ========
  462.  
  463. UNhtml conversion - some html tokens are translated into special character.
  464. & < > become & > <
  465. Tokens of the form &#NUM; are also translated.
  466. This option must be specified on the file handle that is written to..
  467.  
  468. copy ram:test AWNPipe:test/u
  469. copy AWNPipe:test ram:test2
  470.  
  471. P option
  472. ========
  473.  
  474. AWebPost conversion - some special characters are translated into standard 
  475. ascii. This must be specified on the file handle that does the writing.
  476.  
  477. copy ram:test AWNPipe:test/p
  478. copy AWNPipe:test ram:test2
  479.  
  480. B option
  481. ========
  482.  
  483. backwards blocks - characters read from a pipe are returned in reverse order
  484. of the character blocks written. This must be specified on the
  485. file handle that does the reading.
  486.  
  487. if you write 5 blocks of characters .....
  488.  
  489. 'hello'
  490. 'world'
  491. '1'
  492. '2'
  493. '3'
  494.  
  495. they are read back as
  496.  
  497. 321worldhello
  498.  
  499. Funny things can happen if you read before all writes are completed.
  500.  
  501. O option
  502. ========
  503.  
  504.  Adds the text '<option>' after every '0a'x . I use it in AWebNews.
  505.  
  506. copy ram:test AWNPipe:test/o
  507. copy AWNPipe:test ram:test2
  508.  
  509.  
  510. ------------------------------------------------------------------------------
  511.                                   3.3 Paths                                   
  512. ------------------------------------------------------------------------------
  513.  
  514. Controlling data paths.
  515. -----------------------
  516.  
  517. T option
  518. ========
  519.  
  520. TEE's or data taps. A tap is a extra read handle on a pipe connection. If the 
  521. pipe is not yet created the tap will wait for it to be created. A tap does 
  522. not see any data written to the pipe before the tap was created. Taps are 
  523. useful to listen in on interactive (2way) pipes as they read the data written 
  524. to both ends of the pipe.
  525.  
  526. Try this is 3 separate shells.
  527.  
  528. type AWNPipe:test/t
  529. type AWNPipe:test
  530. echo > AWNPipe:test "test data"
  531.  
  532.  
  533. R option
  534. ========
  535.  
  536. Read a file. The second end of a pipe can be connected to file automatically. 
  537. The file name is given after the 'R'.
  538.  
  539. Create a file 'ram:test' containing some text including the characters '<>&'.
  540. Now try this in a shell.
  541.  
  542. type AWNPipe:test/h/rram:test
  543.  
  544. The data from ram:test is read through a modifying pipe.
  545.  
  546. W option
  547. ========
  548.  
  549. Write a file. The second end of a pipe can be connected to file 
  550. automatically. The file name is given after the 'W'.
  551.  
  552. Create a file 'ram:test' containing some text including the characters '<>&'.
  553. Now try this in a shell.
  554.  
  555. copy ram:test AWNPipe:test/h/wram:test2
  556.  
  557. The data from ram:test is copied into a modifying pipe, the pipe 
  558. automatically
  559. outputs the data into a second file ram:test2 .
  560.  
  561. L option
  562. ========
  563.  
  564. Read AND write to an interactive file such as con: . The interactive file 
  565. name is given after the 'L'.
  566.  
  567. This is useful to be able to 'tap' into a two way conversation at a con: or 
  568. other interactive file handle. Instead of opening con: directly, open
  569. AWNPipe:test/Lcon:////mycon/
  570. Now you can open AWNPipe:test/t to tap the data exchanged with the con:.
  571.  
  572. V option
  573. ========
  574.  
  575. This option opens a pipe directly to the clipboard.
  576.  
  577. type AWNPipe:test/v
  578.  
  579. You may also specify a clipboard unit, defaults to 0 (the primary clip).
  580.  
  581. To access clipboard unit 5
  582.  
  583. type AWNPipe:test/v5
  584.  
  585.  
  586. C option
  587.  ========
  588.  
  589. This option allows you to set the clipboard
  590.  
  591. echo "set this as the clip" >AWNPipe:test/c
  592.  
  593. You may also specify a clipboard unit, defaults to 0 (the primary clip)
  594.  
  595. To set clipboard unit 5
  596.  
  597. echo "set this as the clip" >AWNPipe:test/c5
  598.  
  599. E option
  600. ========
  601.  
  602. execute a command . The file name is given after the 'E'. A command is 
  603. executed  with the pipe name as an argument. The pipe name replaces a '%' or 
  604. is placed at the end. You CAN NOT use a '/' instead of a '%' !.
  605.  
  606. copy ram:test.doc AWNPipe:test/h/eaweb3:aweb-II
  607.  
  608. copy ram:test.doc "AWNPipe:test/h/eaweb3:aweb-II % config
  609. local"
  610.  
  611. Both of these load a file ram:test into AWeb through a modifying pipe and 
  612. call AWeb to view it .
  613.  
  614. Into a file requester such as AWebs save requester...
  615. 'awnpipe:jpeg/eUtil:fjpeg_ecs'
  616. will send the data directly to the viewer.
  617.  
  618.  
  619.  
  620. ------------------------------------------------------------------------------
  621.                                  3.4 Internal                                 
  622. ------------------------------------------------------------------------------
  623.  
  624. Internal controls.
  625. -----------------
  626.  
  627. These options control some of the behaviours of AWNP regarding opening pipes 
  628. and reading data.
  629.  
  630. - option
  631. ========
  632.  
  633.  Specify a minimum version of AWNPipe you need. The format is /-VVRRR where V 
  634. is the version and R is the revision.
  635.  Opening AWNPipe:name/-02009 will fail to open unless AWNPipe is version 2.9 
  636. or newer.
  637.  
  638. A option
  639. ========
  640.  
  641.  Abort pending reads.  If you try to open a pipe using the '/a' option any 
  642. pending reads are aborted.  This USUALLY causes the pipe to shut so you can 
  643. reuse the pipename. It is seldom if ever needed now since AWNP catches most 
  644. problems and shuts down 'hung' pipes automatically. The open itself ALWAYS 
  645. fails, this is intended.
  646.  
  647. M option
  648. ========
  649.  
  650.  Multiple opens. When a pipe is opened with this option it behaves normally. 
  651. However when this file handle is closed that end of the pipe becomes 
  652. available to be opened again. If you open the pipe name again with the  '/1' 
  653. (open first end)  flag is set the open call only tries to open the first side 
  654. of the pipe (the end that was opened when the pipe was created). If the 
  655. donotwait flag is set the open call only tries to open the second side of the 
  656. pipe (the end that was NOT opened first). When neither flag is set you get 
  657. the first end of the pipe if available, else you get the second end.
  658.  
  659. I option
  660. ========
  661.  
  662.  Immediate reads. Reads to the file handle will return if there is any data 
  663. waiting to be read. If you try to read 10 characters from the pipe and only 5 
  664. are available, the read returns with the five characters immediately (rather 
  665. than waiting for 5 more characters to be available). Therefore only a read of 
  666. 0 length means end of file. This is useful with data originating  
  667. interactively from con: or ser: .
  668.  
  669. F option
  670. ========
  671.  
  672.  Force a pipe to be created. A new pipe is created even if the pipe name is 
  673. already is use. The open will not fail, and it will not connect to any 
  674. currently existing pipe end. After both ends of the forced pipe are opened 
  675. any previous partial ( only opened once) pipe of that name becomes available 
  676. again. (ONLY FORCE THE FIRST END OF THE PIPE)
  677.  
  678. ! or ~ option.
  679. ==============
  680.  
  681.  Do not wait. The open will fail unless the other end of the pipe is already 
  682. open. A new pipe will not ever be created. Used on a tap it stops the tap 
  683. from waiting for a matching pipe to be created.
  684.  
  685. @ option
  686. ==============
  687.  
  688.  Respond to seek packets. Normally seek is not supported by AWNPipe. If see 
  689. is turned on, the current position is reported as '0' if no data is available 
  690. on the pipe, '1' if data is waiting to be read.
  691.  
  692.  NOTE Do not use this function from ARexx as ARexx has a read ahead buffer
  693. that is flushed when you call seek. This can cause you to loose data. It may
  694. also happen in other languages if read data is buffered.
  695.  
  696. S or s option
  697. ==============
  698.  
  699. Status of a pipe. This MUST always be a tap as well. Read only returns a 
  700. single byte. This is the status of the real pipe the tap refers to. The 
  701. bits/nibbles or byte meanings are as follows.
  702.  
  703. 'FF' indicates  file handle does not exist. (you can check just the high bit)
  704.  
  705. low nibble = First end that is opened.
  706. high nibble =second end opened.
  707.  
  708. in each nibble
  709.  
  710. bit 4 always zero when FH exists
  711. bit 3 FH opened.  (nibble&4)
  712. bit 2 FH closed.  (nibble&2)
  713. bit 1 FH data available.  (nibble&1)  sub for WaitForChar in AREXX.
  714.  
  715. Note 'FF' indicates no file handle active.
  716.  
  717.  
  718.  
  719. ------------------------------------------------------------------------------
  720.                                 3.5 Extensions                                
  721. ------------------------------------------------------------------------------
  722.  
  723. X or x option
  724. ==============
  725.  
  726. These options let you open a pipe whose second end is connected to various
  727. special hosts. (you only open these pipes once)
  728.  
  729. The X option is always followed by additional character(s). The second 
  730. character determines what type of pipe is opened.
  731.  
  732. X0[(r|w)filename]  (Programmable replacement)
  733.  
  734.  Programmable replacement of a character. A single character is looked for in 
  735. data written to the pipe and replaced by a multy character string.
  736.  
  737.  First write two bytes to the pipe. the first byte is always '1' the second 
  738. byte is the target character to be replaced. Then write a byte giving the 
  739. length of the replacement string (<=255) followed by the replacement string. 
  740. Do NOT include a terminating null .
  741.  
  742.  Data written to the pipe after this point is echoed back to the pipe with 
  743. any occurrences of the target character replaced by the specified string.
  744.  
  745.  X0wfilename causes the data to be echoed to a file rather than back to the 
  746. pipe.
  747.  
  748.  X0rfilename causes the data to be read from a file rather than from the 
  749. pipe. Note that the target character and replacement string is still read 
  750. from the pipe not the external file. Only data to be parsed and replaced is 
  751. read from the file.
  752.  
  753. THE THREE TOOLTYPE HOSTS
  754. ------------------------
  755.  
  756. Xt[filename]   (find Tooltypes)
  757.  
  758.  This host is the best suited to quickly check for tooltypes and get there 
  759. values.
  760.  
  761.  The icon file for the specified file (you do NOT add '.icon') is queried.
  762.  
  763.  Open the file awnpipe:myname/Xt[filename]. Write a line containing the 
  764. tooltype you wish to query to the pipe. Read back a response line.
  765.  
  766.  If no icon file is found an eof is returned.
  767.  
  768.  If the tooltype is NOT found you will read back a null line (only a <cr>).
  769.  
  770.  If the tool type IS found you will read back 'ok ' followed by the tooltypes 
  771. value (if it has one).
  772.  
  773. Xi[filename]   (Icon information)
  774.  
  775.  This host will retrieve fuller details about tooltypes and some other icon 
  776. information. It is often used in combination with the following host.
  777.  
  778.  The icon file for the specified file (you do NOT add '.icon') is read. The 
  779. pipe returns the following lines...
  780.  
  781. icon_type x y stack
  782. default tool
  783. tool window
  784. first tooltype
  785. second tooltype
  786. ...
  787.  
  788. If no icon file is found  no data is returned. Note that for blank lines will 
  789. be returned when the information does not apply to that icon type.
  790.  
  791. example: awnpipe:/xidevs:dosdrivers/awnpipe  returns
  792.  
  793. 4 3 139 4096
  794. C:Mount
  795.  
  796. ACTIVATE=0
  797.  
  798. To get information on a volume (say dh1:) use 'awnpipe:/xidh1:disk'.
  799.  
  800. Xs[filename]  (Set icon information)
  801.  
  802.  This host will alter or create the icon and tooltypes for the specified 
  803. file.
  804. Data is written to the host in the same format as returned by the preceding
  805. host.
  806.  
  807. icon_type x y stack
  808. default tool
  809. tool window
  810. first tooltype
  811. second tooltype
  812. third ...
  813.  
  814. Icon_type, x, y, and stack are all integer values written on a single line.
  815.  
  816. Default tool and the tooltypes are ascii strings.
  817.  
  818. Tool window is ignored but MUST still be included, either use a blank line 
  819. ('0A'x) or used the data returned by the Xi host.
  820.  
  821. The first three lines are always required. You may set as many tooltypes as 
  822. you like including none.
  823.  
  824. some useful information:
  825.  
  826. setting x and y to -2147483648 unsnapshots the icon.
  827. icon_type 1=disk 2=drawer 3=tool 4=project
  828.  
  829. Xm[c][(r|w)filename]  (pattern Matching)
  830.  
  831.  Pattern match Conversation. This conversation supports full ADOS pattern 
  832. matching. The trailing 'c' will make the match case sensitive.
  833.  
  834.  Xmwfilename causes the match result to be sent to a file rather than back to 
  835. the pipe.
  836.  
  837.  Xmrfilename causes the data to be read from a file rather than from the 
  838. pipe. The match results are read back from the pipe.
  839.  
  840. NOTE: the replies are ascii terminated with a newline.
  841.  
  842. Write the pattern to the pipe terminated with a newline. (<500 chars) The 
  843. pipe returns 'ok 1' when you sent a valid pattern to match to. It returns 'ok 
  844. 0' if you did not send a pattern ( the pipe will look only
  845. for exact matches).
  846.  
  847. write a string to the pipe terminated with a newline.(<500 chars) read the 
  848. reply  '0' (no match) '1' (is a match)
  849.  
  850. write as many stings as you like . Close pipe to end. The terminating 
  851. newlines are ignored while matching.
  852.  
  853.  
  854. Xk      (Keystroke filter)
  855.  
  856.  Filter keystrokes from the input device event stream and receive 
  857. notifications of the keystroke.
  858.  
  859.  First write a byte to the pipe setting the priority of the key parse 
  860. handler. It is a signed byte -128 to 127. If you are not sure what you want 
  861. use 51 (0x33).
  862.  
  863.  Next  write a byte to the pipe indicating how many keystrokes to filter. The 
  864. maximum is 255 (0x'ff'). 0 is NOT valid.
  865.  
  866. 0x'0a' is 10 keys.
  867.  
  868.  Then write two bytes to the pipe indicating how often a null match should be 
  869. sent (to stop your task waiting forever for a match that never happens).
  870.  
  871.  0x'0032' is 50/100s of a second.
  872.  
  873.  Now write 4 bytes defining each key you wish to be notified of.  The first 
  874. two bytes are the key the second two bytes are the qualifier.
  875.  
  876.  Writing 0x'00200001' to the pipe sets the 'a' key 'leftshifted' to be 
  877. filtered from the event stream.
  878.  
  879.  You MUST set exactly the same amount of keys as specified above.
  880.  
  881.  Once the setup is complete you read notification from the pipe. Each 
  882. notification is 1 byte giving a match number, the first keystroke you 
  883. specified is 1, the second 2 ...
  884.  
  885.  A byte of 0 is a null event, no match occurred.
  886.  
  887.  Close the pipe to end key filtering. NOTE the keyparse handler actually does 
  888. not get removed until the NEXT match or null event.
  889.  
  890. Xe   (key Event generator)
  891.  
  892.  Write keystrokes to the input device event stream.
  893.  
  894.  Each keystroke is sent by writing 4 bytes to this pipe. The first two bytes 
  895. are the key the second two bytes are the qualifier.
  896.  
  897.  Writing 0x'00200001' to the pipe sends the 'a' key 'leftshifted'.
  898.  
  899.  You may close the pipe at any time.
  900.  
  901. Xea   (key events form Ascii)
  902.  
  903.  Write keystrokes to the input device event stream from a string source.
  904.  
  905.  Each keystroke is sent by writing a byte to this pipe. You do NOT need to 
  906. write one character at a time. Simply write ascii text to the pipe and it 
  907. will generate keystrokes as if the string had been typed at the keyboard.
  908.  
  909.  This is easier than writing keycodes and qualifiers to the pipe but you can 
  910. not generate 'special keystrokes' like Alt-F10 .
  911.  
  912.  You may close the pipe at any time.
  913.  
  914. Xc[(r|w)filename]    (ClassAct/Reaction host)
  915.  
  916.  ClassAct Window Conversation. The Window and gadgets are defined by writing 
  917. to the pipe:. Gadget hits and error/confirmation information is read from the 
  918. pipe. A filename may also be given. If the file is specified as write 'w' the 
  919. output of the pipe is directed to that file. If the file is specified as read 
  920. 'r' the window and gadget definitions are read from the file.
  921.  
  922.  See the GUI Creation section of the docs for details.
  923.  
  924. ------------------------------------------------------------------------------
  925.                                 3.6 Tutorials                                 
  926. ------------------------------------------------------------------------------
  927.  
  928.  
  929. ------------------------------------------------------------------------------
  930.                                  3.6.1 Simple                                 
  931. ------------------------------------------------------------------------------
  932.  
  933. HINT: Drag select the text then use right Amiga C to copy the examples out of 
  934. these docs. This helps avoid typos.
  935. ---
  936.  
  937. The simplest use of awnpipe is as an ordinary pipe. That means put data into 
  938. one end of a pipe and read it out the other.
  939.  
  940. In a shell type 'echo >awnpipe:mypipe hello'
  941. Now type 'type awnpipe:mypipe'
  942.  
  943. The word hello went into the pipe from the echo command, and came out with 
  944. the type command.
  945.  
  946. 'mypipe' was the name of the pipe. More than one pipe can exist at the same 
  947. time.
  948.  
  949. In a shell type 'echo >awnpipe:mypipe1 hello'
  950. In a shell type 'echo >awnpipe:mypipe2 goodbye'
  951. In a shell type 'type awnpipe:mypipe1'
  952. In a shell type 'type awnpipe:mypipe2'
  953.  
  954. Two pipes each with a different name.
  955.  
  956. ---
  957.  
  958. Make sure you have two different shells available.
  959.  
  960. In the first shell type 'type awnpipe:mypipe'
  961. In the second shell type 'echo >awnpipe:mypipe hello'
  962.  
  963. You opened the read end of the pipe first. The type command waited until data 
  964. was available from the pipe THEN returned.
  965.  
  966. A word of caution. Don't try to read from both ends of the pipe at the same 
  967. time. If you 'type awnpipe:mypipe1' in two separate shells both will hang 
  968. waiting for data to come from the pipe. AWNPipe notices this and cancels both 
  969. reads to break the deadlock, this causes both type commands to end without 
  970. typing any data.
  971.  
  972. ---
  973.  
  974. To use AWNPipe for other functions you add '/' followed by some parameters to 
  975. the pipe name.'/h' will cause the pipe to translate a few special characters 
  976. to there HTML equivalents. Note that the '/h' is only used when writing to 
  977. the pipe.
  978.  
  979. In a shell type 'echo >awnpipe:mypipe/h "& > <"'
  980. In a shell type 'type awnpipe:mypipe'
  981.  
  982. The data is modified as it pass through the pipe.
  983.  
  984. See the advanced examples for more types of data conversion.
  985.  
  986. ---
  987. It is possible to have a pipe automatically connect it self to a file. In 
  988. these cases you only open the pipe on one end, the other end is automatically 
  989. connected to a file.
  990.  
  991. '/rFILENAME' reads the contents of FILENAME and places it in the pipe.
  992.  
  993. Create a file 'ram:test' containing some text including the characters '<>&'.
  994.  
  995. Now try this in a shell.
  996.  
  997. type AWNPipe:test/h/rram:test
  998.  
  999. (YES there are two colons ':' in the pipename. Strange but don't let it bug 
  1000. you.)
  1001.  
  1002. The data from ram:test is read through a modifying pipe.
  1003.  
  1004. ---
  1005.  
  1006. '/wFILENAME' writes the output of the pipe to FILENAME.
  1007.  
  1008. In a shell type 'echo >awnpipe:mypipe/h/wram:AWNPtest "& > <"'
  1009.  
  1010. Take a look at the file ram:AWNPtest (with your favorite text editor).
  1011.  
  1012. ---
  1013.  
  1014. '/u' reverses the translation done by '/h' and '/rFILENAME' reads data into a
  1015. pipe.
  1016.  
  1017. In a shell type 'type awnpipe:mypipe/u/rram:AWNPtest'
  1018.  
  1019. The contents of the file are read and translated.
  1020.  
  1021. ---
  1022.  
  1023. It is possible to have a pipe automatically connect it self to the clipboard.
  1024.  
  1025. In a shell type 'echo >awnpipe:mypipe/c hello'
  1026.  
  1027. The word hello was placed into the clipboard. Use your text editor to check 
  1028. it out. Then put different text into the clipboard using your text editor.
  1029.  
  1030. In a shell type 'type awnpipe:mypipe/v'
  1031.  
  1032.  The contents of the clipboard are typed out.
  1033.  
  1034.  
  1035. ------------------------------------------------------------------------------
  1036.                                 3.6.2 Advanced                                
  1037. ------------------------------------------------------------------------------
  1038.  
  1039. You should read the simple examples before trying these more advanced ones.
  1040.  
  1041. HINT: use right Amiga C the drag then clip the examples out of these docs to 
  1042. avoid typos.
  1043.  
  1044.  
  1045. ---
  1046.  
  1047. It is possible to tap into or duplicate the data passed in a pipe. '/t' will 
  1048. add a readonly third end to a pipe.
  1049.  
  1050. Make sure you have two different shells available.
  1051.  
  1052. In the first shell type 'type awnpipe:mypipe/t'
  1053.  
  1054. In the second shell type 'echo >awnpipe:mypipe hello'
  1055. In the second shell type 'type awnpipe:mypipe '
  1056.  
  1057.  The word hello came back from both the second end of the pipe and the 'Tap' 
  1058. third end.
  1059.  
  1060. ---
  1061.  
  1062. In the first shell type 'copy con:////pipe-test/close awnpipe:mypipe'
  1063. In the second shell type 'type awnpipe:mypipe '
  1064.  
  1065. Type a few lines of text into the test con:, nothing comes out in the second 
  1066. shell. Close the test con:, now the data comes out. This is because the type 
  1067. command wants to read large blocks of data.
  1068.  
  1069. '/i' will cause data to pass out of the pipe immediately (as soon as its 
  1070. available).
  1071.  
  1072. In the first shell type 'copy con:////pipe-test/close awnpipe:mypipe'
  1073. In the second shell type 'type awnpipe:mypipe/i '
  1074.  
  1075. Now the text comes out of the pipe each time you hit return in the test con:.
  1076. Close the test con: to end the example.
  1077.  
  1078. ---
  1079.  
  1080. You can use AWNPipe to read the tooltypes of an icon. The second end of the 
  1081. pipe automatically reads the tooltypes of FILENAME when '/xiFILENAME' is 
  1082. used. NOTE that parameters that start with '/x' can not be mixed with other 
  1083. parameters!
  1084.  
  1085. In a shell type 'type awnpipe:mypipe/xiDevs:dosdrivers/awnpipe'
  1086.  
  1087. YES the pipe name contains two colons ':', don't let it bug you.
  1088.  
  1089. The tooltype information from Devs:dosdrivers/awnpipe prints out. Note you do 
  1090. not include '.info' in the file name.
  1091.  
  1092. The data is typed out in the following format..
  1093.  
  1094. icon_type x y stack
  1095. default tool
  1096. tool window
  1097. first tooltype
  1098. second tooltype
  1099. ...
  1100.  
  1101. If you get some weird number (-2147483648) for the X and Y values it means 
  1102. you did not snapshot the icon yet.
  1103.  
  1104. ---
  1105.  
  1106. You can also use AWNPipe to write the tooltypes of an icon.
  1107.  
  1108. Copy a file with its icon into ram:., preferably an icon that has some 
  1109. tooltypes set in it.
  1110.  
  1111. In a shell 'copy awnpipe:/xiRam:filename ram:icondump' , do not include 
  1112. '.info' in the filename.
  1113.  
  1114. Now examine and edit the file ram:icondump change the default tool and 
  1115. tooltypes.
  1116.  
  1117. In a shell 'copy ram:icondump awnpipe:/xsRam:filename '.
  1118.  
  1119. Use the WB menu info function to verify the new setting in the icon.
  1120.  
  1121. ---
  1122.  
  1123.  AWNPipe can be used to pattern match. '/xm' is used for pattern matching. 
  1124. Data is usually written into the pipe, and the results of the pattern 
  1125. matching read back from THE SAME END OF THE PIPE. The second end of the pipe 
  1126. is automatically connected to a task that is doing the pattern matching. 
  1127. '/xmrFILENAME' causes the data to be read from a file rather than the pipe, 
  1128. the match results are read from the pipe.
  1129.  
  1130. In a shell type 'type awnpipe:mypipe/xmrcon:////pipetest/close'
  1131.  
  1132. In the pipetest con: type '#?a' . This sets a pattern to match any text 
  1133. ending in 'a'. 'ok 1' should come back from the pipe. ('ok 0' would means you 
  1134. did not enter a pattern so an exact match will be tested for.)
  1135.  
  1136. In the pipetest con: enter some text. If the text ends with 'a' then the pipe 
  1137. responds with '1' meaning a match. If not the pipe responds with '0' meaning 
  1138. no match. Close the pipe test con: to end the example.
  1139.  
  1140.  
  1141. ------------------------------------------------------------------------------
  1142.                                  3.6.3 Tricks                                 
  1143. ------------------------------------------------------------------------------
  1144.  
  1145.  
  1146. Now for some strange looking but powerful ideas. You don't have to understand 
  1147. them all just give them a try. Some interesting things can be done by setting 
  1148. a few simple aliases. Some of these aliases take advantage of AWNPipes GUI 
  1149. building feature covered in a different section of these docs.
  1150.  
  1151. alias see  echo >awnpipe:/xc "defg*nbitmap fn []*nimage*nopen"
  1152.  
  1153. Now 'see FILENAME' will display pictures using your datatypes.
  1154.  
  1155. alias readtext  echo >awnpipe:/xc "defg a cs *ntextfield a minw 200 minh 200 
  1156. gt 0 bd ro datain []*nopen"
  1157.  
  1158. Now 'readtext FILENAME' will display a textfile.
  1159.  
  1160. alias toolt  type awnpipe:/xi[]
  1161.  
  1162. Now 'toolt FILENAME' will display the tooltypes of FILENAME. (do not include 
  1163. .info in FILENAME).
  1164.  
  1165. alias text2html copy awnpipe:t2h/f/h/r[]
  1166.  
  1167. Now 'text2html infile outfile' will create special html sequences for certain 
  1168. characters in a text file and save it in a new file.
  1169.  
  1170. alias html2text copy awnpipe:t2h/f/u/r[]
  1171.  
  1172. Now 'html2text infile outfile' will convert special HTML sequences in a html 
  1173. file and save it in a new file.
  1174.  
  1175. ---
  1176.  
  1177. This next example is rather complex and is best studied after you have a 
  1178. working knowledge of AWNP.
  1179.  
  1180. It might be useful to be able to check an icons tooltype from an ADOS script, 
  1181. as earlier examples
  1182. have shown the '/Xt' option can do this. There is a problem however. You need 
  1183. to write data to the
  1184. pipe (the tooltype you wish to check), and read data from the pipe (the 
  1185. response to your query).
  1186.  
  1187.  It is simple to write data to the pipe with echo.
  1188.  
  1189. 'echo "filetype" >awnpipe:test/Xtpath:file'
  1190.  
  1191.  A pipe connected to path:file.icon is opened and the data 'filetype' is 
  1192. written to it. When the echo
  1193. command completes it closes the pipe. This breaks the connection to the 
  1194. tooltype host and the host
  1195. exits. You do not get a chance to read the response from the host.
  1196.  
  1197.  The '/m' option (multiple opens) solves this by allowing you to open the 
  1198. pipe connection to the
  1199. tooltype host more than once.
  1200.  
  1201.  'echo "filetype" >awnpipe:test/m/Xtpath:file'
  1202.  
  1203.  Again a pipe is connected to the tooltype host is created and sent data. 
  1204. This time however when echo
  1205. closes its pipe the connection to the host is not lost. AWNPipe knows you 
  1206. want to connect to the same
  1207. pipe again later.
  1208.  
  1209.  'type awnpipe:test'
  1210.  
  1211.  This reads the response back from the tooltype host. Note you only specified 
  1212. the pipe name, you do
  1213. NOT include '/Xtpath:file' again. When the type command completes the 
  1214. connection to the host is broken
  1215. and the host exits.
  1216.  
  1217.  This idea can be taken a step further.
  1218.  
  1219.  'echo "filetype" >awnpipe:test/m/Xtpath:file'
  1220.  'type awnpipe:test/m'
  1221.  'echo "filesize" >awnpipe:test/m'
  1222.  'type awnpipe:test/m'
  1223.  'echo "filedate" >awnpipe:test/m'
  1224.  'type awnpipe:test'
  1225.  
  1226. The connection to the host is not broken until you finally open the pipe a 
  1227. last time without the '/m'
  1228. option.
  1229.  
  1230.  
  1231. ------------------------------------------------------------------------------
  1232.                                 4 GUI Creation                                
  1233. ------------------------------------------------------------------------------
  1234.  
  1235.  
  1236. ------------------------------------------------------------------------------
  1237.                                4.1 Conversation                               
  1238. ------------------------------------------------------------------------------
  1239.  
  1240.  
  1241. ------------------------------------------------------------------------------
  1242.                                  4.1.1 Basic                                  
  1243. ------------------------------------------------------------------------------
  1244.  
  1245.  The sections on the conversation are important but do not try to memorize it 
  1246. all. It is enough to understand the general process.
  1247.  
  1248.  GUIs are defined and operated by means of a conversation with a special host 
  1249. built into the AWNP device. The host is accessed by opening a file . You  
  1250. write lines of text to the file and read the file to see the response.
  1251.  
  1252.  The GUI is defined by writing text lines to the file. You first write a line 
  1253. that defines the window title and other attributes of the window you want to 
  1254. create. Now you read back a response line from the pipe to make sure the 
  1255. window definition was ok. Next you write a line of text defining a gadget to 
  1256. have in the window and read another response line. This line will contain the 
  1257. Gadget ID assigned to the gadget you created. You can create as many gadgets 
  1258. as you like.
  1259.  Once you finish defining gadgets you open the window by writing a line 
  1260. containing the single word 'open'. You read back a response line confirm the 
  1261. window opened ok.
  1262.  
  1263.  Now that the GUI is created and open you simply continue to read lines from 
  1264. the file. When the user selects a gadget in the GUI you receive an event line 
  1265. containing the GID of the gadget selected and other data such the text 
  1266. entered in a string gadget. When the GUI window is closed you receive an 
  1267. EndOfFile.
  1268.  
  1269.  In some cases you will want to modify a gui after it has already been 
  1270. opened. This can be done by writing a lines of text to the file after it has 
  1271. been opened or after you read an event. You read a response to the modify 
  1272. line.
  1273.  
  1274.  For many GUIs you can tell the host to not send any response lines making 
  1275. the conversation even simpler. You can just write the GUI definition lines 
  1276. then read the event lines.
  1277.  
  1278.  
  1279. ------------------------------------------------------------------------------
  1280.                               4.1.2 Step by Step                              
  1281. ------------------------------------------------------------------------------
  1282.  
  1283. Understanding the conversation is the key to building GUIs with AWNP. Here is 
  1284. a walk through the creation and use of a simple example.
  1285.  
  1286.   Open the file AWNPipe:myGUI/xc. myGUI can be any name you want.The /xc must 
  1287. be used as it tells AWNPipe this file is for GUi creation. From now on I will 
  1288. refer to this file as the 'pipe'
  1289.  
  1290. Write a Window definition line to the pipe.
  1291. 'title "My First gui" defaultgadgets'
  1292. The line read from the pipe should be
  1293. 'ok window'
  1294. Anything else is an error response.
  1295.  
  1296. Write a Gadget definition line to the pipe. 
  1297. 'button gadgettext "testbutton"
  1298. The line read from the pipe should be
  1299. 'ok 1'
  1300. The Gadget ID of the button is 1. If the response line does not start with 
  1301. 'ok' then an error has occurred.
  1302.  
  1303. Write a Gadget definition line to the pipe. 
  1304. 'checkbox gadgettext "tryme"
  1305. The line read from the pipe should be
  1306. 'ok 2'
  1307. The Gadget ID of the checkbox is 2. If the response line does not start with 
  1308. 'ok' then an error has occurred.
  1309.  
  1310.  
  1311. Write open command line to the pipe.
  1312. 'open'
  1313. The line read from the pipe should be
  1314. 'ok window'
  1315. Anything else is an error response.
  1316.  
  1317. Now you read an event from the pipe. It will come when the user selects a 
  1318. gadget. 
  1319.  
  1320. If the checkbox is selected you get the line
  1321. 'gadget 2 1'
  1322. the first word 'gadget tells you the event was from a gadget being hit. 2 is 
  1323. the gadgets GID, the 1 at the end tells you the checkbox is now selected.
  1324.  
  1325. If the checkbox is selected a second time you get the line
  1326. 'gadget 2 1'
  1327. the first word 'gadget tells you the event was from a gadget being hit. 2 is 
  1328. the gadgets GID, the 0 at the end tells you the checkbox is now unselected.
  1329.  
  1330. If the button is selected you get the line
  1331. 'gadget 1 0'
  1332. the first word 'gadget tells you the event was from a gadget being nit. 1 is 
  1333. the gadgets GID, the 0 at the end tells you the button is not highlighted. In 
  1334. this example you can ignore the 0 (button state).
  1335.  
  1336. when the GUI window is closed you get the line
  1337. 'close 0'
  1338. the first word 'close' tells you the event was from the window being closed. 
  1339. 0 (close source) tells you it closed when the close gadget was hit. If the 
  1340. user entered <CTRL\>' the close source would be -1. After the close event any 
  1341. further attempts to read the pipe will return EndOfFile.
  1342.  
  1343. You keep reading events until the end of file is received. You could also 
  1344. close the pipe after the close event is read. 
  1345.  
  1346.  
  1347. This is a second conversation in which the GUI is modified after it is 
  1348. opened. 
  1349.  
  1350.   Open the file AWNPipe:myGUI/xc. 
  1351. Write a Window definition line to the pipe.
  1352. 'title "My First gui" defaultgadgets modify'
  1353. The modify keyword tells the pipe you want to be able to modify this GUI 
  1354. later.
  1355. The line read from the pipe should be
  1356. 'ok window'
  1357.  
  1358. Write a Gadget definition line to the pipe. 
  1359. 'button gadgettext "testbutton"
  1360. The line read from the pipe should be
  1361. 'ok 1'
  1362.  
  1363. Write a Gadget definition line to the pipe. 
  1364. 'checkbox gadgettext "tryme"
  1365. The line read from the pipe should be
  1366. 'ok 2'
  1367.  
  1368. Write open command line to the pipe.
  1369. 'open'
  1370. The line read from the pipe should be
  1371. 'ok window'
  1372.  
  1373. After the window is opened you get your first chance to modify it. We want to 
  1374. disable the button so we send the following line.
  1375. 'ID 1 disable 1 refresh'
  1376. The button is specified with 'ID 1' and 'disable 1' disables it. The refresh 
  1377. at the end tells the pipe to refresh the button so the changes show.
  1378. The line read from the pipe should be
  1379. 'ok'
  1380. If the response does not start with 'ok' an error occurred.
  1381.  
  1382. We also want the check mark to show as selected so we write the line
  1383. 'ID 2 selected 1'
  1384. The button is specified with 'ID 1' and 'selected 1' turns causes it to be 
  1385. checked (the checkmark showing in the box). The refresh at the end tells the 
  1386. pipe to refresh the button so the changes show.
  1387. The line read from the pipe should be
  1388. 'ok'
  1389.  
  1390. WE have finished modifying the GUI for now so we send a line to tell the pipe 
  1391. we are finished sending modify instruction and want to read an event from the 
  1392. pipe.
  1393. 'continue'
  1394. The line read from the pipe should be
  1395. 'ok'
  1396.  
  1397. Now you read an events from the pipe.  
  1398.  
  1399. If the checkbox is selected you get the line
  1400. 'gadget 2 0'
  1401. The user selected the checkbox gadget, it is now unchecked. We want enable 
  1402. the button gadget. AFTER SENDING AN EVENT THE PIPE STARTS READING MODIFY 
  1403. INSTRUCTIONS AGAIN. We send the following modify line to the pipe.
  1404. 'ID 1 disable 0 refresh'
  1405. The button is specified with 'ID 1' and 'disable 0' enables it. The refresh 
  1406. at the end tells the pipe to refresh the button so the changes show.
  1407. The line read from the pipe should be
  1408. 'ok'
  1409. WE have finished modifying the GUI for now so we send a line to tell the pipe 
  1410. we are finished sending modify instruction and want to read another event.
  1411. 'continue'
  1412. The line read from the pipe should be
  1413. 'ok'
  1414.  
  1415. If the checkbox is selected a second time you get the line
  1416. 'gadget 2 1'
  1417. The 1 at the end tells you the checkbox is now selected. We want to disable 
  1418. the button gadget so we send the line
  1419. 'ID 1 disable 1 refresh'
  1420. The line read from the pipe should be
  1421. 'ok'
  1422. WE have finished modifying the GUI for now so we send a line to tell the pipe 
  1423. we are finished sending modify instruction and want to read another event.
  1424. 'continue'
  1425. The line read from the pipe should be
  1426. 'ok'
  1427.  
  1428. If the button is selected you get the line
  1429. 'gadget 1 0'
  1430. WE do not want to modify anything at this time but we still need to send the 
  1431. continue line so the pipe will stop looking for modify lines and send us 
  1432. another event.
  1433. 'continue'
  1434. The line read from the pipe should be
  1435. 'ok'
  1436.  
  1437. when the GUI window is closed you get the line
  1438. 'close 0'
  1439. The window is closed but we can still send modify commands. For example we 
  1440. could read the final state of the gadgets. In this case we will do nothing 
  1441. but send the continue line.
  1442. 'continue'
  1443. The line read from the pipe should be
  1444. 'ok'
  1445. Any further reads from the pipe return EOF.
  1446.  
  1447. You keep reading an event then sending modify commands until the end of file 
  1448. is received. You could also close the pipe after the close event is read. 
  1449.  
  1450.  
  1451. ------------------------------------------------------------------------------
  1452.                                 4.1.3 Details                                 
  1453. ------------------------------------------------------------------------------
  1454.  
  1455.  When building a complex GUI you will use objects other than simple gadgets. 
  1456. These objects are created the same way as gadgets, by writing a line to the 
  1457. pipe and then reading a response. Some of these objects return a GID and some 
  1458. simply return an ok.
  1459.  
  1460.  You will also handle more types of events than just gadget and close events. 
  1461. You can receive menu events, keystrokes, window activation and other types of 
  1462. events. These events are handled the same way gadget events are handled.
  1463.  
  1464.  A wide range of modify commands can be used. As well as modifying gadgets 
  1465. you can iconify the window, read gadget contents, set the windows busy 
  1466. pointer and other things. The range of modify commands you use will be 
  1467. determined by the type program you are writing.
  1468.  
  1469.  Some types of gadget events (textfields, texteditors), and ARexx events 
  1470. require special handling since they can be more than one line. The tutorials 
  1471. will show you how to handle these events.
  1472.  
  1473.  You should now work through the examples. They will not only help you learn 
  1474. to use AWNP, they will provide example code you can use for the basis of your 
  1475. own GUIs.
  1476.  
  1477. ------------------------------------------------------------------------------
  1478.                                  4.2 Objects                                  
  1479. ------------------------------------------------------------------------------
  1480.  
  1481.  
  1482. ------------------------------------------------------------------------------
  1483.                                  4.2.1 Window                                 
  1484. ------------------------------------------------------------------------------
  1485.  
  1486. The parameters defining the CA window must all be on one line terminated by a 
  1487. newline. The pipe will reply with 'window ok'.
  1488.  
  1489.  
  1490. screentitle="screen title text"  (st=)
  1491.  
  1492.  Set the text for the screen title when CA window is active.
  1493.  
  1494. title="window title text"
  1495.  
  1496.  Set the title for the CA window.
  1497.  
  1498. pubscreen="Screen name"  (ps=)
  1499.  
  1500.  Open the CA window on a public screen
  1501.  
  1502. IconifyIcon (ii=)
  1503.  
  1504. Set the name of the icon to use when you iconify the window.
  1505.  
  1506. IconTitle="icon title text"  (it=)
  1507.  
  1508.  Set the title for the CA window when iconified.
  1509.  
  1510. backfill="filename"  (bf=)
  1511.  
  1512.  Image file to use as backfill for window. If backfill is not specified you 
  1513. get the default window backfill. Setting backfill="" can be used to have no 
  1514. backfill at all. Use this carefully as it overrides the user CA prefs.
  1515.  
  1516. NoBorder (NB)
  1517.  
  1518.  Make the window borderless.
  1519.  
  1520. Quiet  (q)
  1521.  
  1522.  Tell the pipe not to reply to the window, gadget definitions, or modify 
  1523. commands. This is actually a toggle switch turning replies off and on. SOME 
  1524. modify commands are ALWAYS replied to. (addnode and getfile selected 0|1)
  1525.  
  1526. NoWindow
  1527.  
  1528.  switch to causes no window to be opened. This will not work unless modify is 
  1529. set and an arexx object is defined.
  1530.  
  1531. app
  1532.  
  1533.  Make  this  window a application window.
  1534.  
  1535. activate  (a)
  1536.  
  1537.  Switch to activate theCA window when it opens.
  1538.  
  1539. depthgadget (dg)
  1540.  
  1541.  Switch to include a depth gadget on the CA window.
  1542.  
  1543. dragbar  (db)
  1544.  
  1545.  Switch to include a drag bar on the CA window.
  1546.  
  1547. closegadget (cg)
  1548.  
  1549.  Switch to include a close gadget on the CA window.
  1550.  
  1551. askclose
  1552.  
  1553.  Switch to stop the close gadget from actually closing the window. The close 
  1554. gadget will generate an 'askclose' event instead. This switch is ignored 
  1555. unless modify is also set.
  1556.  
  1557. sizegadget (sg)
  1558.  
  1559.  Switch to include a window size gadget on the CA window.
  1560.  
  1561. iconifygadget  (ig)
  1562.  
  1563.  Switch to include an iconify gadget on the CA window.
  1564.  
  1565. fullscreen    (fs)
  1566. centerscreen   (cs)
  1567. topleft         (tl)
  1568.  
  1569.  Relative position to open the CA window at. Defaults to centermouse.
  1570.  
  1571. top=number
  1572. left=number
  1573. width=umber
  1574. height=number
  1575.  
  1576.  Position and size to open  the CA window. Using the left parameter over 
  1577. rides the relative positioning above.
  1578.  
  1579. vertical     (v)
  1580.  
  1581.  Switch to display gadgets vertically, defaults to horizontal.
  1582.  
  1583. even    (e)
  1584.  
  1585.  Switch to make gadgets/groups all the same size.
  1586.  
  1587. defaultgadgets  (defg)
  1588.  
  1589.  Switch to include close, depth, size, and drag gadgets on the CA window.
  1590.  
  1591. sendkeys  (sk)
  1592.  
  1593.  Switch to have the CA window return keystrokes.
  1594.  
  1595. sendqual  (sq)
  1596.  
  1597.  Switch to have the CA window send qualifier events. (see events.doc)
  1598.  
  1599. modify   (m)
  1600.  
  1601.  Switch to allow the CA window to be modified AFTER it has been opened.
  1602. (See modify parameters below)
  1603.  
  1604. help (h)
  1605.  
  1606.   Switch to have the CA window return help events.
  1607.  
  1608. state
  1609.  
  1610. Switch to have the CA window return active/inactive events.
  1611.  
  1612. refresh
  1613.  
  1614. Switch to have the CA window return refresh events. This is only useful if 
  1615. you are doing your rendering directly into the window.
  1616.  
  1617. defer
  1618.  
  1619.  Switch to defer window layout from the input device to the pipe task. This 
  1620. will make input.device more responsive, and drop the (possibly quite 
  1621. heavy)process of recalculating the display to normal application priority 
  1622. instead of the priority 20 of input.device.
  1623.  
  1624.  It also means window refresh is blocked if you are sending modify commands 
  1625. to the pipe. The window refreshes AFTER you send 'continue'.
  1626.  
  1627. SpaceOuter (so)
  1628.  
  1629.  Leave a blank space outside the  root layout of the CA window.
  1630.  
  1631. SpaceInner  (si)
  1632.  
  1633.  Leave a blank space around elements in the root layout of the CA window.
  1634.  
  1635. fixwidth (fw)
  1636.  
  1637.  Do not allow the width of the window to be adjusted.
  1638.  
  1639. fixheight (fh)
  1640.  
  1641.  Do not allow the width of the window to be adjusted.
  1642.  
  1643. shrinkwrap (sw)
  1644.  
  1645.  Keep all gadgets in the window as close together as possible.
  1646.  
  1647. specialchar="character" (sc=)
  1648.  
  1649.  'Character' is a single character that replaces '|', in use as a separator 
  1650. inside parameters like chooserlabels, tags, penmapdata, ...
  1651.  
  1652. tags="tags|data[|tag|data...]|0
  1653.  
  1654.  A list of tag and value pairs in HEX. Do not forget the trailing null !
  1655.  
  1656. info
  1657.  
  1658.  Include the drawinfo pen array for the screen in the reply to the window 
  1659. definition line.
  1660.  
  1661.  If successful the reply is
  1662.  
  1663. 'ok window NUMBERofPENS PEN0 PEN1 ...'
  1664.  
  1665. see include:intuition/screen.h for more about drawinfo pens.
  1666.  
  1667.  
  1668. Modify GID 0
  1669. ------------
  1670.  
  1671. GID 0 is used to specify the GUI window itself. It can be used in modify 
  1672. lines to control certain aspects of the window.
  1673.  
  1674. selected=function_bitmap (s=)
  1675. This should really have been in HEX but its not for backward compatability.
  1676.  
  1677. bit# decimal function
  1678.  
  1679. 0       1      activate window
  1680. 1       2      window to front
  1681. 2       4      window to back
  1682. 3       8      set window title
  1683. 4      16      set screen title
  1684. 5      32      iconify window
  1685. 6      64      uniconify (or open) window
  1686. 7     128      Close window (but do not dispose)
  1687. 8     256      Set busy pointer and disable window
  1688. 9     512      Clear busy pointer and enable window
  1689.  
  1690. You can use more than one function at the same time. 66=uniconify and 
  1691. windowtofront.
  1692.  
  1693. gadgettext=  (gt=)
  1694.  
  1695.  Text for setting screen or window title.
  1696.  
  1697. disable=BOOL  (dis=)
  1698.  
  1699.  0 enables all gadgets in window.
  1700.  !1 disables all gadgets
  1701.  
  1702. wide=num
  1703. high=num
  1704.  
  1705.  Attempt to resize the window to the given width and/or height.Set wide=1 
  1706. high=1 to get the minimum size possible.
  1707.  
  1708. top=num
  1709. left=num
  1710.  
  1711.  Move the window to the given position(s).
  1712.  
  1713. 'ID 0 read'
  1714. returns the windows 'left top width height' settings. (width and height 
  1715. report as 0 until you get at least 1 event back from the
  1716. pipe)
  1717.  
  1718. refresh (ref)
  1719.  
  1720.  Refresh all gadgets in the window.
  1721.  
  1722.  
  1723. ------------------------------------------------------------------------------
  1724.                              4.2.2 Simple Gadgets                             
  1725. ------------------------------------------------------------------------------
  1726.  
  1727.  
  1728. ------------------------------------------------------------------------------
  1729.                                 4.2.2.1 Button                                
  1730. ------------------------------------------------------------------------------
  1731.  
  1732. Button gadget event
  1733. -------------------------
  1734.  
  1735. 'gadget GID selected_state'
  1736.  
  1737. selected_state =0 not selected,!=0 selected
  1738.  
  1739. Button gadget parameters.
  1740. -------------------------
  1741.  
  1742. font=GID
  1743.  
  1744. This sets the font for the gadget. The GID must point to an ALREADY defined 
  1745. text attribute.
  1746.  
  1747. close (c)
  1748.  
  1749.  This gadget will close the window when selected by the user.
  1750.  
  1751. readonly (ro)
  1752.  
  1753.  This gadget is read only.
  1754.  
  1755. disable=number (dis=)
  1756.  
  1757.  The gadget is enabled if number = 0 , disabled if number !=0. Defaults to 
  1758. enabled.
  1759.  
  1760. selected=number (s=)
  1761.  
  1762.   The gadget is selected if number != 0 , unselected if number = 0. Defaults 
  1763. to unselected.
  1764.  
  1765. autobutton=number (ab)
  1766.  
  1767.  This button uses a scaled glyph image. The number selects the glyph.
  1768.  
  1769. 0 POPFILE
  1770. 1 POPDRAWER
  1771. 2 POPFONT
  1772. 3 CHECKBOX
  1773. 4 CANCELBOX
  1774. 5 UPARROW
  1775. 6 DNARROW
  1776. 7 RTARROW
  1777. 8 LFARROW
  1778. 9 POPTIME
  1779. 10 POPSCREEN
  1780. 11 POPUP
  1781.  
  1782. pushbutton  (pb)
  1783.  
  1784.  This button is a pushbutton.
  1785.  
  1786. gadgettext="text"  (gt=)
  1787.  
  1788.  Set the text of the gadget.
  1789.  
  1790. bevel=TYPE  (b=)
  1791.  
  1792.  Set the bevel type for this gadget.
  1793. 0=NONE
  1794. 1=THIN
  1795. 2=BUTTON
  1796. 3=GROUP
  1797. 4=FIELD
  1798. 5=DROPBOX
  1799. 6=SBAR_HORIZ
  1800. 7=SBAR_VERT
  1801. 8=BOX
  1802. 9=STANDARD
  1803.  
  1804. leftjustify  (lj)
  1805. rightjustify (rj)
  1806.  
  1807.  Set the justification of the text for the gadget. Defaults to centerjustify.
  1808.  
  1809. minwidth=number  (minw=)
  1810.  
  1811.  Set the minimum width for this gadget
  1812.  
  1813. minheight=number (minh=)
  1814.  
  1815.  Set the minimum height for this gadget
  1816.  
  1817. weightedwidth=number   (weiw=)
  1818.  
  1819.  Set the weighted width for this gadget
  1820.  
  1821. weightedheight=number  (weih=)
  1822.  
  1823.  Set the weighted height for this gadget
  1824.  
  1825. nominalsize   (noms)
  1826.  
  1827.  Set this gadget to its nominal size.
  1828.  
  1829. useimage   (ui)
  1830.  
  1831.  Use the last defined image (bitmap/drawlist/penmap) as the gadgets image.
  1832.  
  1833. Anim="x|y|wide|high|offsetx|offsety|count"
  1834.  
  1835.  Use portions of a bitmap for this gadgets image(s).
  1836. x,y              the left and top pixel of the first image.
  1837. wide,high        the size of the images.
  1838. offsetx,offsety  the offset to the next image.
  1839. count            must be 0 for a standard two image button
  1840.                  (normal and selected image)
  1841.  
  1842. The first image is the gadget graphic, the offset is to the
  1843. selected image. offsets can be 0 to use a single image.
  1844.  
  1845. If count!=0 an array of images is produced to allow animation of the button.
  1846. If count >0 an array of count images is built. The button image is set to
  1847. the first image in the array.
  1848. If count <0 an array of absolute value(count)*2 images is built. The button 
  1849. image is set to the first image in the array. The selected image is set to 
  1850. image absolute value(count)+1.
  1851.  
  1852. See the 'animimage' modify parameter for details about animating the button.
  1853.  
  1854.  
  1855. FileName='path:file'
  1856.  
  1857.  A image file to use as the source bitmap for the anim data. If no file name 
  1858. is given an anim is given the bitmap from the previous anim will be reused. 
  1859. This bitmap in held in a buffer shared by bitmap images. See the image 
  1860. docs-bitmap for more info.
  1861.  
  1862. trans
  1863.  
  1864.  The animation background should be transparent if the image type allows it.
  1865.  
  1866. tags="tags|data[|tag|data...]|0
  1867.  
  1868.  A list of tag and value pairs in HEX. Do not forget the trailing null !
  1869.  
  1870. childlabel    (chl)
  1871. childlabelr   (chlr)
  1872.  
  1873.  Use the previously defined image as a childlabel for this gadget. Display 
  1874. the childlabel to the right or left of the gadget.
  1875.  
  1876. replace=GID
  1877.  
  1878.  Use this gadget to replace an existing gadget specified by GID.
  1879.  
  1880. Definition Reply
  1881. -----------------
  1882.  
  1883.  When the gadget creation is successful the pipe replies with
  1884.  
  1885. 'ok GID'
  1886.  
  1887. Button gadget modify parameters.
  1888. -------------------------
  1889.  
  1890. readonly=number (ro=)
  1891.  
  1892.  The gadget is readonly if number = 1 , functional if number= 0. Note that 
  1893. this is different handling then in gadget definitions.
  1894.  
  1895. disable=number (dis=)
  1896.  
  1897.  The gadget is enabled if number = 0 , disabled if number != 0.
  1898.  
  1899. selected=number (s=)
  1900.  
  1901.   The gadget is selected if number != 0 , unselected if number = 0.
  1902.  
  1903. gadgettext="text"  (gt=)
  1904.  
  1905.  Set the text of the gadget.
  1906.  
  1907. newimage=number (ni=)
  1908.  
  1909.  Replace the gadget image with a previously defined image. If number =0 
  1910. replace normal image, else replace selected image.
  1911.  
  1912. animimage=number  (ai=)
  1913.  
  1914.  When used with the 'newimage' keyword the button image is replaced with an 
  1915. image from the buttons image array. The image to be used is specified by 
  1916. number.
  1917.  
  1918. get=TAG
  1919.  
  1920.  Read the value of a specific gadget attribute. Returns a blank line if 
  1921. attribute is not readable. This should not be combined with any other modify 
  1922. command on the same line.
  1923.  
  1924. read
  1925.  
  1926.  returns the state of the button
  1927.  
  1928. refresh (ref)
  1929.  
  1930.  Redraw the gadget.
  1931.  
  1932. ------------------------------------------------------------------------------
  1933.                                4.2.2.2 Integer                                
  1934. ------------------------------------------------------------------------------
  1935.  
  1936. Integer gadget event
  1937. -------------------------
  1938.  
  1939. 'gadget GID integer_value'
  1940.  
  1941. Integer gadget parameters.
  1942. -------------------------
  1943.  
  1944. font=GID
  1945.  
  1946. This sets the font for the gadget. The GID points to an ALREADY defined text 
  1947. attribute.
  1948.  
  1949. TabCycle (tc)
  1950.  
  1951.  This gadget can be activated using the tab key.
  1952.  
  1953. close (c)
  1954.  
  1955.  This gadget will close the window when selected by the user.
  1956.  
  1957. readonly (ro)
  1958.  
  1959.  This gadget is read only.
  1960.  
  1961. disable=number (dis=)
  1962.  
  1963.  The gadget is enabled if number = 0 , disabled if number != 0. Defaults to 
  1964. enabled.
  1965.  
  1966. arrows (a)
  1967.  
  1968.  Switch to display up/down arrows for this gadget.
  1969.  
  1970. minchars=number (minc=)
  1971.  
  1972.  Minimum number of character/digits in this gadget.
  1973. Defaults to 5.
  1974.  
  1975. maxchars=number (maxc=)
  1976.  
  1977.  Maximum number of character/digits in this gadget.
  1978. Defaults to 10.
  1979.  
  1980. minnumber=number (minn=)
  1981.  
  1982.  Minimum value for this gadget. Defaults to 0.
  1983.  
  1984. maxnumber=number (maxn=)
  1985.  
  1986.  Maximum value for this gadget. Defaults to 32768.
  1987.  
  1988. defnumber=number (defn=)
  1989.  
  1990.  Value for this gadget when window is opened. Defaults to 1.
  1991.  
  1992. leftjustify (lj)
  1993. centerjustify (cj)
  1994.  
  1995.  Set the justification of the text for the gadget. Defaults to rightjustify.
  1996.  
  1997. minwidth=number (minw=)
  1998.  
  1999.  Set the minimum width for this gadget
  2000.  
  2001. minheight=number (minh=)
  2002.  
  2003.  Set the minimum height for this gadget
  2004.  
  2005. weightedwidth=number (weiw=)
  2006.  
  2007.  Set the weighted width for this gadget
  2008.  
  2009. weightedheight=number (weih=)
  2010.  
  2011.  Set the weighted height for this gadget
  2012.  
  2013. nominalsize (noms)
  2014.  
  2015.  Set this gadget to its nominal size.
  2016.  
  2017. tags="tags|data[|tag|data...]|0
  2018.  
  2019.  A list of tag and value pairs in HEX. Do not forget the trailing null !
  2020.  
  2021. childlabel    (chl) childlabelr   (chlr)
  2022.  
  2023.  Use the previously defined image as a childlabel for this gadget. Display 
  2024. the childlabel to the right or left of the gadget.
  2025.  
  2026. replace=GID
  2027.  
  2028.  Use this gadget to replace an existing gadget specified by GID.
  2029.  
  2030. Definition Reply
  2031. -----------------
  2032.  
  2033.  When the gadget creation is successful the pipe replies
  2034. with
  2035.  
  2036. 'ok GID'
  2037.  
  2038. Integer gadget modify parameters.
  2039. -------------------------
  2040.  
  2041. disable=number (dis=)
  2042.  
  2043.  The gadget is enabled if number = 0 , disabled if number != 0.
  2044.  
  2045. defnumber=number (defn=)
  2046.  
  2047.  Set the value for this gadget.
  2048.  
  2049.  
  2050.  
  2051. ------------------------------------------------------------------------------
  2052.                                 4.2.2.3 String                                
  2053. ------------------------------------------------------------------------------
  2054.  
  2055. String gadget event
  2056. -------------------------
  2057.  
  2058. 'gadget GID string'
  2059.  
  2060. String gadget parameters.
  2061. -------------------------
  2062.  
  2063. font=GID
  2064.  
  2065. This sets the font for the gadget. The GID points to an ALREADY defined text 
  2066. attribute.
  2067.  
  2068. TabCycle (tc)
  2069.  
  2070.  This gadget can be activated using the tab key.
  2071.  
  2072. close (c)
  2073.  
  2074.  This gadget will close the window when selected by the user.
  2075.  
  2076. readonly (ro)
  2077.  
  2078.  This gadget is read only.
  2079.  
  2080. disable=number (dis=)
  2081.  
  2082.  The gadget is enabled if number = 0 , disabled if number != 0. Defaults to 
  2083. enabled.
  2084.  
  2085. gadgettext="text" (gt=)
  2086.  
  2087.  Set the text in the gadget.
  2088.  
  2089. minchars=number (minc=)
  2090.  
  2091.  Minimum number of character/digits in this gadget. Defaults to 10.
  2092.  
  2093. maxchars=number (maxc=)
  2094.  
  2095.  Maximum number of character/digits in this gadget. Defaults to 100.
  2096.  
  2097. leftjustify (lj)
  2098. centerjustify (cj)
  2099.  
  2100.  Set the justification of the text for the gadget. Defaults to rightjustify.
  2101.  
  2102. minwidth=number (minw=)
  2103.  
  2104.  Set the minimum width for this gadget
  2105.  
  2106. minheight=number (minh=)
  2107.  
  2108.  Set the minimum height for this gadget
  2109.  
  2110. weightedwidth=number (weiw=)
  2111.  
  2112.  Set the weighted width for this gadget
  2113.  
  2114. weightedheight=number (weih=)
  2115.  
  2116.  Set the weighted height for this gadget
  2117.  
  2118. nominalsize (noms)
  2119.  
  2120.  Set this gadget to its nominal size.
  2121.  
  2122. replace=GID
  2123.  
  2124.  Use this gadget to replace an existing gadget specified by GID.
  2125.  
  2126. Definition Reply
  2127. -----------------
  2128.  
  2129.  When the gadget creation is successful the pipe replies with
  2130.  
  2131. 'ok GID'
  2132.  
  2133. String gadget modify parameters.
  2134. -------------------------
  2135.  
  2136. disable=number (dis=)
  2137.  
  2138.  The gadget is enabled if number = 0 , disabled if number != 0.
  2139.  
  2140. gadgettext="text" (gt=)
  2141.  
  2142.  Set the text in the gadget.
  2143.  
  2144. selected=num  (s=)
  2145.  
  2146.  Set the cursor position in a string gadget, and activate the gadget.
  2147.  
  2148. bufferpos
  2149.  
  2150.  Read the current cursor position in the string gadget. This keyword should 
  2151. be used by itself. ( 'id GID getposition')
  2152.  
  2153.  It is replied to with 'POSITION ok'.
  2154.  
  2155.  
  2156. ------------------------------------------------------------------------------
  2157.                                4.2.2.4 CheckBox                               
  2158. ------------------------------------------------------------------------------
  2159.  
  2160. CheckBox gadget event
  2161. -------------------------
  2162.  
  2163. 'gadget GID selected_state'
  2164.  
  2165.  
  2166. CheckBox gadget parameters.
  2167. -------------------------
  2168.  
  2169. font=GID
  2170.  
  2171. This sets the font for the gadget. The GID points to an ALREADY defined text 
  2172. attribute.
  2173.  
  2174. close (c)
  2175.  
  2176.  This gadget will close the window when selected by the user.
  2177.  
  2178. readonly (ro)
  2179.  
  2180.  This gadget is read only.
  2181.  
  2182. disable=number (dis=)
  2183.  
  2184.  The gadget is enabled if number = 0 , disabled if number != 0. Defaults to 
  2185. enabled.
  2186.  
  2187. selected=number (s=)
  2188.  
  2189.   The gadget is selected if number != 0 , unselected if number = 0. Defaults 
  2190. to unselected.
  2191.  
  2192. gadgettext="text" (gt=)
  2193.  
  2194.  Set the text of the gadget.
  2195.  
  2196. leftjustify (lj)
  2197.  
  2198.  Set the placement of the text for the gadget. Defaults to Rightjustify.
  2199.  
  2200. minwidth=number (minw=)
  2201.  
  2202.  Set the minimum width for this gadget
  2203.  
  2204. minheight=number (minh=)
  2205.  
  2206.  Set the minimum height for this gadget
  2207.  
  2208. weightedwidth=number (weiw=)
  2209.  
  2210.  Set the weighted width for this gadget
  2211.  
  2212. weightedheight=number (weih=)
  2213.  
  2214.  Set the weighted height for this gadget
  2215.  
  2216. nominalsize (noms)
  2217.  
  2218.  Set this gadget to its nominal size.
  2219.  
  2220. tags="tags|data[|tag|data...]|0
  2221.  
  2222.  A list of tag and value pairs in HEX. Do not forget the trailing null !
  2223.  
  2224. childlabel    (chl)
  2225. childlabelr   (chlr)
  2226.  
  2227.  Use the previously defined image as a childlabel for this gadget. Display 
  2228. the childlabel to the right or left of the gadget.
  2229.  
  2230. replace=GID
  2231.  
  2232.  Use this gadget to replace an existing gadget specified by GID.
  2233.  
  2234. Definition Reply
  2235. -----------------
  2236.  
  2237.  When the gadget creation is successful the pipe replies with
  2238.  
  2239. 'ok GID'
  2240.  
  2241. CheckBox gadget modify parameters.
  2242. -------------------------
  2243.  
  2244. disable=number (dis=)
  2245.  
  2246.  The gadget is enabled if number = 0 , disabled if number != 0.
  2247.  
  2248. selected=number (s=)
  2249.  
  2250.   The gadget is selected if number != 0 , unselected if number = 0.
  2251.  
  2252. gadgettext="text" (gt=)
  2253.  
  2254.  Set the text of the gadget.
  2255.  
  2256.  
  2257. ------------------------------------------------------------------------------
  2258.                                4.2.2.5 Chooser                                
  2259. ------------------------------------------------------------------------------
  2260.  
  2261. Chooser gadget event
  2262. -------------------------
  2263.  
  2264. 'gadget GID selected'
  2265.  
  2266. selected = the selected choice in the chooser.
  2267.  
  2268. Chooser gadget parameters.
  2269. -------------------------
  2270.  
  2271. font=GID
  2272.  
  2273. This sets the font for the gadget. The GID points to an ALREADY defined text 
  2274. attribute.
  2275.  
  2276. close (c)
  2277.  
  2278.  This gadget will close the window when selected by the user.
  2279.  
  2280. readonly (ro)
  2281.  
  2282.  This gadget is read only.
  2283.  
  2284. disable=number (dis=)
  2285.  
  2286.  The gadget is enabled if number = 0 , disabled if number !=0. Defaults to 
  2287. enabled.
  2288.  
  2289. gadgettext="text" (gt=)
  2290.  
  2291.  Set the text for the gadget.
  2292.  
  2293. selected=number (s=)
  2294.  
  2295.   Set which choice is selected when the window opens. Selections start at 0 . 
  2296. This defaults to choice 0.
  2297.  
  2298. ChooserLabels="choice0|choice1|choice..." (cl)
  2299.  
  2300.  Set the choices for the gadget. Maximum 50 choices, do not exceed this !
  2301.  
  2302. Maxnumber=count (maxn=)
  2303.  
  2304.  The maximum number of selection to display. Defaults to 12.
  2305.  
  2306. Popup   (pu)
  2307.  
  2308.  This is a popup chooser. Defaults to dropdown.
  2309.  
  2310. minwidth=number (minw=)
  2311.  
  2312.  Set the minimum width for this gadget
  2313.  
  2314. minheight=number (minh=)
  2315.  
  2316.  Set the minimum height for this gadget
  2317.  
  2318. weightedwidth=number (weiw=)
  2319.  
  2320.  Set the weighted width for this gadget
  2321.  
  2322. weightedheight=number (weih=)
  2323.  
  2324.  Set the weighted height for this gadget
  2325.  
  2326. nominalsize (noms)
  2327.  
  2328.  Set this gadget to its nominal size.
  2329.  
  2330. tags="tags|data[|tag|data...]|0
  2331.  
  2332.  A list of tag and value pairs in HEX. Do not forget the
  2333. trailing null !
  2334.  
  2335. childlabel    (chl)
  2336. childlabelr   (chlr)
  2337.  
  2338.  Use the previously defined image as a childlabel for this gadget. Display 
  2339. the childlabel to the right or left of the gadget.
  2340.  
  2341. TabCycle (tc)
  2342.  
  2343.  This gadget can be selected by cycling with the tab key.
  2344.  
  2345. replace=GID
  2346.  
  2347.  Use this gadget to replace an existing gadget specified by GID.
  2348.  
  2349. Definition Reply
  2350. -----------------
  2351.  
  2352.  When the gadget creation is successful the pipe replies with
  2353.  
  2354. 'ok GID'
  2355.  
  2356. Chooser gadget modify parameters.
  2357. -------------------------
  2358.  
  2359. disable=number (dis=)
  2360.  
  2361.  The gadget is enabled if number = 0 , disabled if number !=0.
  2362.  
  2363. selected=number (s=)
  2364.  
  2365.   Set which choice is selected . Selections start at 0 .
  2366.  
  2367. chooserlabels="choice0|choice1|choice..." (cl=)
  2368.  
  2369.  Change the choices available in the chooser.
  2370.  
  2371. defnumber=count (defn=)
  2372.  
  2373.  The maximum number of selection to display.
  2374.  
  2375.  
  2376. ------------------------------------------------------------------------------
  2377.                              4.2.2.6 RadioButton                              
  2378. ------------------------------------------------------------------------------
  2379.  
  2380. Radio Button gadget event
  2381. -------------------------
  2382.  
  2383. 'gadget GID selected_state'
  2384.  
  2385. Radio Button gadget parameters.
  2386. -------------------------
  2387.  
  2388. font=GID
  2389.  
  2390. This sets the font for the gadget. The GID points to an ALREADY defined text 
  2391. attribute.
  2392.  
  2393. close (c)
  2394.  
  2395.  This gadget will close the window when selected by the user.
  2396.  
  2397. readonly (ro)
  2398.  
  2399.  This gadget is read only.
  2400.  
  2401. disable=number (dis=)
  2402.  
  2403.  The gadget is enabled if number = 0 , disabled if number != 0. Defaults to 
  2404. enabled.
  2405.  
  2406. selected=number (s=)
  2407.  
  2408.   Set which choice is selected when the window opens. Selections start at 0 . 
  2409. This defaults to choice 0.
  2410. to unselected.
  2411.  
  2412. RadioLabels="choice0|choice1|choice..."  (rl=)
  2413.  
  2414.  Set the choices for the gadget. This parameter MUST be given.
  2415.  
  2416. minwidth=number (minw=)
  2417.  
  2418.  Set the minimum width for this gadget
  2419.  
  2420. minheight=number (minh=)
  2421.  
  2422.  Set the minimum height for this gadget
  2423.  
  2424. weightedwidth=number (weiw=)
  2425.  
  2426.  Set the weighted width for this gadget
  2427.  
  2428. weightedheight=number (weih=)
  2429.  
  2430.  Set the weighted height for this gadget
  2431.  
  2432. nominalsize (noms)
  2433.  
  2434.  Set this gadget to its nominal size.
  2435.  
  2436. replace=GID
  2437.  
  2438.  Use this gadget to replace an existing gadget specified by GID.
  2439.  
  2440. Definition Reply
  2441. -----------------
  2442.  
  2443.  When the gadget creation is successful the pipe replies with
  2444.  
  2445. 'ok GID'
  2446.  
  2447. Radio Button gadget modify parameters.
  2448. -------------------------
  2449.  
  2450. disable=number (dis=)
  2451.  
  2452.  The gadget is enabled if number = 0 , disabled if number != 0.
  2453.  
  2454. selected=number (s=)
  2455.  
  2456.  Set the current selection of the radio button.
  2457.  
  2458.  
  2459.  
  2460. ------------------------------------------------------------------------------
  2461.                                  4.2.3 Images                                 
  2462. ------------------------------------------------------------------------------
  2463.  
  2464.  
  2465. ------------------------------------------------------------------------------
  2466.                                 4.2.3.1 Label                                 
  2467. ------------------------------------------------------------------------------
  2468.  
  2469. Label gadget parameters.
  2470. -------------------------
  2471.  
  2472. The label produces an image and usually putts it into your GUI right away. To 
  2473. use the label as a child label of a gadget You MUST use the unattached 
  2474. keyword.
  2475.  
  2476. unattached (ua)
  2477.  
  2478. The unattached keyword does not produce a gadget. It creates an image to be 
  2479. used .Up to 10 images can be predefined, the last one defined is the first 
  2480. one used. Last In First Out.
  2481.  
  2482. font=GID
  2483.  
  2484. This sets the font for the label. The GID points to an ALREADY defined text 
  2485. attribute.
  2486.  
  2487. Selected=num (s=)
  2488.  
  2489.  Set the pen number used to render the text.
  2490.  
  2491. gadgettext="Label text"  (gt=)
  2492.  
  2493.  Set the text of the Label.
  2494.  
  2495. underscore="CHAR"
  2496.  
  2497.  Use an alternate character to flag the hotkey for the label. CHAR is a 
  2498. single character. This defaults to underscore '_', changing it will allow an 
  2499. underscore to be used as a plain character in a label.
  2500.  
  2501. leftjustify  (lj)
  2502. rightjustify (rj)
  2503.  
  2504.  Set the justification of the text for the gadget. Defaults to centerjustify.
  2505.  
  2506. minwidth=number  (minw=)
  2507.  
  2508.  Set the minimum width for this gadget
  2509.  
  2510. minheight=number (minh=)
  2511.  
  2512.  Set the minimum height for this gadget
  2513.  
  2514. weightedwidth=number  (weiw=)
  2515.  
  2516.  Set the weighted width for this gadget
  2517.  
  2518. weightedheight=number (weih=)
  2519.  
  2520.  Set the weighted height for this gadget
  2521.  
  2522. nominalsize  (noms)
  2523.  
  2524.  Set this gadget to its nominal size.
  2525.  
  2526. useimage   (ui)
  2527.  
  2528.  Use the last defined image (bitmap/drawlist/penmap) as the gadgets image.
  2529.  
  2530. Even
  2531.  
  2532.  Correct a possible layout problem in the image position. You will probably 
  2533. never use this parameter. Technically it moves th image up one pixel, which 
  2534. is useful when mixing different fonts in the same line.
  2535.  
  2536. Definition Reply
  2537. ----------------
  2538.  
  2539.  When the image creation is successful the pipe replies with
  2540.  
  2541. 'ok WIDTH HEIGHT'
  2542.  
  2543.  
  2544. ------------------------------------------------------------------------------
  2545.                                 4.2.3.2 Glyph                                 
  2546. ------------------------------------------------------------------------------
  2547.  
  2548. Glyph parameters
  2549. -------------------
  2550.  
  2551. The glyph keyword does not produce a gadget. It creates an image to be used 
  2552. later. Up to 10 images can be predefined, the last one defined is the first 
  2553. one used. Last In First Out.
  2554.  
  2555. defnumber=number (defnum)
  2556.  
  2557.  Choose the image this glyph displays. the possible values number are
  2558.  
  2559. 0 NONE
  2560. 1 DOWNARROW
  2561. 2 UPARROW
  2562. 3 LEFTARROW
  2563. 4 RIGHTARROW
  2564. 5 DROPDOWN
  2565. 6 POPUP
  2566. 7 CHECKMARK
  2567. 8 POPFONT
  2568. 9 POPFILE
  2569. 10 POPDRAWER
  2570. 11 POPSCREENMODE
  2571. 12 POPTIME
  2572. 13 RADIOBUTTON
  2573. 14 RETURNARROW
  2574.  
  2575. Definition Reply
  2576. -----------------
  2577.  
  2578.  When the image creation is successful the pipe replies with
  2579.  
  2580. 'ok '
  2581.  
  2582.  
  2583. ------------------------------------------------------------------------------
  2584.                                4.2.3.3 DrawList                               
  2585. ------------------------------------------------------------------------------
  2586.  
  2587. DrawList parameters
  2588. -------------------
  2589.  
  2590. The drawlist keyword does not produce a gadget. It creates an image to be 
  2591. used later. Up to 10 images can be predefined, the last one defined is the 
  2592. first one used. Last In First Out.
  2593.  
  2594. bindata (bd)
  2595.  
  2596. The drawlistdata will be passed to this pipe in binary after the command 
  2597. line. The drawlistdata parameter now gives the length of the data. Setting 
  2598. datain means the data is read from an external file rather than the pipe.
  2599.  
  2600. dataout="filename" (do=)
  2601.  
  2602.  Send the data for this gadget to a file. This is a development tool to allow 
  2603. you to create binary data to pass to the pipe. It is ignored if the Bindata 
  2604. keyword is also present.
  2605.  
  2606. datain="filename" (di=)
  2607.  
  2608.  Read the data for this gadget from a file. It is ignored if the Bindata 
  2609. keyword is not present.
  2610.  
  2611. minheight=number (minh)
  2612.  
  2613.  Set the height of the virtual raster the drawlist data
  2614. relates to.
  2615.  
  2616. minwidth=number (minw)
  2617.  
  2618.  Set the width of the virtual raster the drawlist data relates
  2619. to.
  2620.  
  2621. drawlistdata="value1|value2|..."   (dld=)
  2622.  
  2623.  The draw list data defines a set of drawing instruction to create an image. 
  2624. Each drawing instruction has 6 values.
  2625. directive|X1|Y1|X2|Y2|pen
  2626.  
  2627. The possible directives are
  2628.  
  2629. 0 END
  2630. 1 LINE
  2631. 2 RECT
  2632. 3 FILL
  2633. 4 ELLIPSE
  2634. 5 CIRCLE
  2635. 6 LINEPAT
  2636. 7 FILLPAT
  2637. 8 AMOVE
  2638. 9 ADRAW
  2639. 10 AFILL
  2640. 11 BEVELBOX
  2641. 12 ARC
  2642. 13 START = BOUNDS
  2643. 14 LINESIZE
  2644.  
  2645. Register as a Class Act developer and read the docs for more info on 
  2646. drawlists.
  2647.  
  2648. When sending binary data you send an array of structure DrawLists.
  2649.  
  2650. struct DrawList
  2651.             {
  2652.                 WORD dl_Directive;
  2653.                 WORD dl_X1, dl_Y1;
  2654.                 WORD dl_X2, dl_Y2;
  2655.                 WORD dl_Pen;
  2656.             };
  2657. The last structure MUST be END (dl_Directive=0).
  2658.  
  2659. Definition Reply
  2660. -----------------
  2661.  
  2662.  When the image creation is successful the pipe replies with
  2663.  
  2664. 'ok'
  2665.  
  2666.  
  2667.  
  2668. ------------------------------------------------------------------------------
  2669.                                 4.2.3.4 PenMap                                
  2670. ------------------------------------------------------------------------------
  2671.  
  2672. PenMap parameters
  2673. -------------------
  2674.  
  2675. The penmap keyword does not produce a gadget.  It creates an image to be used 
  2676. later. Up to 10 images can be predefined, the last one defined is the first 
  2677. one used. Last In First Out.
  2678.  
  2679. bindata (bd)
  2680.  
  2681. The PenMapPalette,penmapdata, and selectedimage  will be passed to this pipe 
  2682. in binary after the command line, AND IN THAT ORDER. The 
  2683. penmapdata,selectedimage, and PenMapPalette parameters now give the length of 
  2684. each data segment. Do NOT specify a data length of 0 for selected image, omit 
  2685. the keyword instead.
  2686.  
  2687. dataout="filename" (do)
  2688.  
  2689.  Send the data for this gadget to a file. This is a development tool to allow 
  2690. you to create binary data to pass to the pipe. It is ignored if the Bindata 
  2691. keyword is also present.
  2692.  
  2693. penmapdata="data" (pmd)
  2694.  
  2695. The image data. NOTE all values are ascii HEX. The data is in the following 
  2696. format.
  2697.  
  2698. "width_h_byte|width_l_byte|height_h_byte|height_l_byte|data1|data2..."
  2699.  
  2700. If the bindata keyword is used the image data is the following format
  2701.  
  2702. word width, height;
  2703. char data[];
  2704.  
  2705. Note the size specified in penmapdata INCLUDES the 4 bytes for width and 
  2706. height.
  2707.  
  2708. selectedimage="data" (si)
  2709.  
  2710. The image data for a selected image. NOTE all values are ascii HEX. The data 
  2711. is in the following format.
  2712.  
  2713. "width_h_byte|width_l_byte|height_h_byte|height_l_byte|data1|data2..."
  2714.  
  2715. If the bindata keyword is used the image data is the same format as
  2716. for penmapdata.
  2717.  
  2718. PenMapPalette="data" (pmp)
  2719.  
  2720. The palate data. NOTE all values are ascii HEX. The data is in the following 
  2721. format.
  2722.  
  2723. "triplet_count|red1|green1|blue1|red2|..."
  2724.  
  2725. If the bindata keyword is used the palate data is the format
  2726.  
  2727.            ULONG palette[] =
  2728.            {
  2729.                number_triplets,
  2730.                red1, green1, blue1,
  2731.                red2, green2, blue2,
  2732.                ...
  2733.            };
  2734.  
  2735.  
  2736.  
  2737. Trans
  2738.  
  2739.  Make pen 0 transparent.
  2740.  
  2741.  
  2742. ------------------------------------------------------------------------------
  2743.                                 4.2.3.5 Bitmap                                
  2744. ------------------------------------------------------------------------------
  2745.  
  2746. BitMap parameters
  2747. -------------------
  2748.  
  2749. The bitmap keyword does not produce a gadget. It creates an image to be used 
  2750. later. Up to 10 images can be predefined, the last one defined is the first 
  2751. one used. Last In First Out.
  2752.  
  2753. FileName='path:file' (fn)
  2754.  
  2755.  The file to read and produce an image from using datatypes.
  2756.  
  2757. selectedimage='path:file' (si)
  2758.  
  2759.  The file to read and produce the selected image from using datatypes.
  2760.  
  2761. trans
  2762.  
  2763. Make the image background transparent
  2764. (if the associated image and datatype allows this).
  2765.  
  2766. Part="x|y|wide|high|offsetx|offsety|buffer"
  2767.  
  2768. x,y              the left and top pixel of the first image.
  2769. wide,high        the size of the images.
  2770. offsetx,offsety  the offset to the selected state image.
  2771. buffer           the buffer used to store the root bitmap. (0-4)
  2772.                  ( buffer 0 is also used for button animations )
  2773.  
  2774.  Use portions of a bitmap for this image.
  2775.  
  2776. The image is only part of the root bitmap specified by x|y|wide|high, the 
  2777. offsets can be set to 0 to make the normal and selected state the same.
  2778.  
  2779. filename="" will cause this image to use the next available predefined bitmap
  2780. for the root bitmap. (only with 'part')
  2781.  
  2782. Not including a file name at all will reuse an existing root bitmap. This 
  2783. allows you to only load one bitmap with a images needed. You can then reuse 
  2784. parts mutiple times. Also you only need to have a single image file for most 
  2785. applications rather than several small ones.(only with part)
  2786.  
  2787.  It is possible to redefine an image buffer. When this is done the previous 
  2788. contents of the image buffer are saved before the new bitmap is created. See 
  2789. the freeimage modify command for more information on handling image buffers.
  2790.  
  2791. Definition Reply
  2792. -----------------
  2793.  
  2794.  When the image creation is successful the pipe replies with
  2795.  
  2796. 'ok BITMAP_width BITMAP_height'
  2797.  
  2798.  
  2799. ------------------------------------------------------------------------------
  2800.                                 4.2.3.6 Image                                 
  2801. ------------------------------------------------------------------------------
  2802.  
  2803. Image gadget parameters.
  2804. -------------------------
  2805.  
  2806. You must first define an image before you can produce an image gadget. The 
  2807. last defined image is placed into the GUI.
  2808.  
  2809. minwidth=number  (minw=)
  2810.  
  2811.  Set the minimum width for this gadget
  2812.  
  2813. minheight=number (minh=)
  2814.  
  2815.  Set the minimum height for this gadget
  2816.  
  2817. weightedwidth=number  (weiw=)
  2818.  
  2819.  Set the weighted width for this gadget
  2820.  
  2821. weightedheight=number (weih=)
  2822.  
  2823.  Set the weighted height for this gadget
  2824.  
  2825. nominalsize  (noms)
  2826.  
  2827.  Set this gadget to its nominal size.
  2828.  
  2829. Definition Reply
  2830. -----------------
  2831.  
  2832.  When the gadget creation is successful the pipe replies with
  2833.  
  2834. 'ok'
  2835.  
  2836. ------------------------------------------------------------------------------
  2837.                                 4.2.3.7 Space                                 
  2838. ------------------------------------------------------------------------------
  2839.  
  2840.  
  2841. Space gadget parameters.
  2842. -------------------------
  2843.  
  2844. trans
  2845.  
  2846.  Turn transparency on for this space.
  2847.  
  2848. minwidth=number  (minw=)
  2849.  
  2850.  Set the minimum width for this gadget
  2851.  
  2852. minheight=number (minh=)
  2853.  
  2854.  Set the minimum height for this gadget
  2855.  
  2856. bevel=TYPE  (b=)
  2857.  
  2858.  Set the bevel type for this gadget. Defaults to none.
  2859. 0=NONE
  2860. 1=THIN
  2861. 2=BUTTON
  2862. 3=GROUP
  2863. 4=FIELD
  2864. 5=DROPBOX
  2865. 6=SBAR_HORIZ
  2866. 7=SBAR_VERT
  2867. 8=BOX
  2868. 9=STANDARD
  2869.  
  2870.  
  2871. Definition Reply
  2872. -----------------
  2873.  
  2874.  When the gadget creation is successful the pipe replies with
  2875.  
  2876. 'ok'
  2877.  
  2878. ------------------------------------------------------------------------------
  2879.                                 4.2.4 Special                                 
  2880. ------------------------------------------------------------------------------
  2881.  
  2882.  
  2883. ------------------------------------------------------------------------------
  2884.                              4.2.4.1 Layout(End)                              
  2885. ------------------------------------------------------------------------------
  2886.  
  2887. LayOutEnd parameters
  2888. ----------------------
  2889.  
  2890. LayOutEnd=le=pg
  2891.  
  2892. (pg is for historical reasons)
  2893.  
  2894. This ends the current layout group. It takes no parameters.
  2895.  
  2896. layout parameters.
  2897. -------------------------
  2898.  
  2899. Layouts can be nested up to 10 deep.
  2900.  
  2901. page=GID
  2902.  
  2903.  Use this layout group as a page in the Clicktab gadget
  2904. specified by GID.
  2905.  
  2906. selected=number (s=)
  2907.  
  2908.  The clicktab page to be displayed on startup, defaults to
  2909. 0. Ignored unless page is also specified. It is only
  2910. useful when adding the final page to a clicktab.
  2911.  
  2912. font=GID
  2913.  
  2914. This sets the font for the whole group. The GID points to
  2915. an ALREADY defined text attribute.
  2916.  
  2917.  
  2918. bevel=TYPE  (b=)
  2919.  
  2920.  Set the bevel type for this gadget.
  2921. 0=NONE
  2922. 1=THIN
  2923. 2=BUTTON
  2924. 3=GROUP
  2925. 4=FIELD
  2926. 5=DROPBOX
  2927. 6=SBAR_HORIZ
  2928. 7=SBAR_VERT
  2929. 8=BOX
  2930. 9=STANDARD
  2931.  
  2932.  
  2933. gadgettext="group label" (gt=)
  2934.  
  2935.  set the group label for this group. Ignored if nobevel is
  2936. set.
  2937.  
  2938. labr
  2939. labl
  2940. labc
  2941.  Set the position of the layout label (topleft/topright/topcenter). Defaults 
  2942. to the users prefs setting, so don't set/force this unless you really need 
  2943. to..
  2944.  
  2945. minwidth=number (minw=)
  2946.  
  2947.  Set the minimum width for this gadget
  2948.  
  2949. minheight=number (minh=)
  2950.  
  2951.  Set the minimum height for this gadget
  2952.  
  2953. weightedwidth=number (weiw=)
  2954.  
  2955.  Set the weighted width for this gadget
  2956.  
  2957. weightedheight=number (weih=)
  2958.  
  2959.  Set the weighted height for this gadget
  2960.  
  2961. nominalsize (noms)
  2962.  
  2963.  Set this gadget to its nominal size.
  2964.  
  2965. SpaceOuter (so)
  2966.  
  2967.  Leave a blank space outside the layout group.
  2968.  
  2969. SpaceInner  (si)
  2970.  
  2971.  Leave a blank space around elements in the layout group.
  2972.  
  2973. disable=number (dis=)
  2974.  
  2975.  The gadgets in this layout are enabled if number = 0 , disabled if number != 
  2976. 0. Defaults to enabled.
  2977.  
  2978. centerjustify  (cj)
  2979. rightjustify   (rj)
  2980. bottomjustify  (bj)
  2981.  
  2982.  Set the justification of the gadgets in this layout. Defaults to leftjustify 
  2983. or topjustify.
  2984.  
  2985. vertical      (v)
  2986.  
  2987.  Switch to display gadgets vertically, defaults to horizontal.
  2988.  
  2989. even      (e)
  2990.  
  2991.  Switch to make gadgets/groups all the same size.
  2992.  
  2993. shrinkwrap  (sw)
  2994.  
  2995.  Switch to cause gadgets in this group to have no space between them.
  2996.  
  2997. tags="tags|data[|tag|data...]|0
  2998.  
  2999.  A list of tag and value pairs in HEX. Do not forget the trailing null !
  3000.  
  3001. childlabel    (chl)
  3002. childlabelr   (chlr)
  3003.  
  3004.  Use the previously defined image as a childlabel for this gadget. Display 
  3005. the childlabel to the right or left of the gadget.
  3006.  
  3007. replace=GID
  3008.  
  3009.  Use this gadget to replace an existing gadget specified by GID.
  3010.  
  3011. Definition Reply
  3012. -----------------
  3013.  
  3014.  When the gadget creation is successful the pipe replies with
  3015.  
  3016. 'ok GID'
  3017.  
  3018.  LayoutEnd replies with
  3019.  
  3020. 'ok'
  3021.  
  3022. layout modify parameters.
  3023. -------------------------
  3024.  
  3025. disable=number (dis=)
  3026.  
  3027.  The gadgets in this layout are enabled if number = 0 , disabled if number != 
  3028. 0. Defaults to enabled.
  3029.  
  3030. refresh (ref)
  3031.  
  3032.  
  3033. ------------------------------------------------------------------------------
  3034.                                4.2.4.2 ClickTab                               
  3035. ------------------------------------------------------------------------------
  3036.  
  3037. ClickTab gadget event
  3038. -------------------------
  3039.  
  3040. 'gadget GID selected_page'
  3041.  
  3042. ClickTab gadget parameters.
  3043. -------------------------
  3044.  
  3045. This actually creates a pair of connected gadgets, a clicktab->pagegadget. 
  3046. Each tab labels will display a different page in the page gadget. See parent 
  3047. group for how
  3048. to attach a page to a clicktab gadget.
  3049.  
  3050. font=GID
  3051.  
  3052. This sets the font for the gadget. The GID points to an ALREADY defined text 
  3053. attribute.
  3054.  
  3055. readonly (ro)
  3056.  
  3057.  This gadget is read only.
  3058.  
  3059. disable=number (dis=)
  3060.  
  3061.  The gadget is enabled if number = 0 , disabled if number != 0. Defaults to 
  3062. enabled.
  3063.  
  3064. ClickTabLabels="choice0|choice1|choice..." (ctl)
  3065.  
  3066.  Set the choices for the gadget. This parameter MUST be given.
  3067.  
  3068. minwidth=number (minw=)
  3069.  
  3070.  Set the minimum width for this gadget
  3071.  
  3072. minheight=number (minh=)
  3073.  
  3074.  Set the minimum height for this gadget
  3075.  
  3076. weightedwidth=number (weiw=)
  3077.  
  3078.  Set the weighted width for this gadget
  3079.  
  3080. weightedheight=number (weih=)
  3081.  
  3082.  Set the weighted height for this gadget
  3083.  
  3084. nominalsize (noms)
  3085.  
  3086.  Set this gadget to its nominal size.
  3087.  
  3088. replace=GID
  3089.  
  3090.  Use this gadget to replace an existing gadget specified by GID.
  3091.  
  3092. Definition Reply
  3093. -----------------
  3094.  
  3095.  When the gadget creation is successful the pipe replies with
  3096.  
  3097. 'ok GID'
  3098.  
  3099. ClickTab gadget modify parameters.
  3100. -------------------------
  3101.  
  3102. disable=number (dis=)
  3103.  
  3104.  The gadget is enabled if number = 0 , disabled if number != 0.
  3105.  
  3106. NOTE: when you disable a layout, Clicktab gadgets in the layout do not
  3107. properly disable themselves (CA/Reaction bug?). You must manualy disable the
  3108. clicktabs your self.
  3109.  
  3110. target=number  (tar=)
  3111.  
  3112.  When used with disable only the targeted tab is enabled or disabled. If
  3113. target is not specified all tabs will be disabled or enabled.
  3114.  
  3115. selected=number  (s=)
  3116.  
  3117.  Set the page displayed by the clicktab gadget.
  3118.  
  3119. refresh (ref)
  3120.  
  3121.  Redraw the gadget.
  3122.  
  3123. ------------------------------------------------------------------------------
  3124.                                4.2.4.3 TextAttr                               
  3125. ------------------------------------------------------------------------------
  3126.  
  3127. TextAttr parameters.
  3128. -------------------------
  3129.  
  3130. gadgettext="fontname"  (gt=)
  3131.  
  3132. This text defines the font.  Remember the '.font' like 'gt=topaz.font'
  3133.  
  3134. defnumber=number  (defn=)
  3135.  
  3136. The font size attribute.
  3137.  
  3138. selected="number"  s=
  3139.  
  3140. The fonts style attributes. Sorry it a decimal number...
  3141.  
  3142. Definition Reply
  3143. -----------------
  3144.  
  3145.  When the gadget creation is successful the pipe replies with
  3146.  
  3147. 'ok GID HEXADDRESS'
  3148.  
  3149. The address allows you to use the text attribute with the 'set' modify 
  3150. command.
  3151.  
  3152.  The same text attribute can be used to specify a font for many gadgets.
  3153.  
  3154. ------------------------------------------------------------------------------
  3155.                              4.2.4.4 BrowserNode                              
  3156. ------------------------------------------------------------------------------
  3157.  
  3158. BrowserNode gadget parameters.
  3159. -------------------------
  3160.  
  3161.  Browsernodes always belong to last defined listbrowser. NEVER use the 
  3162. BrowserNode keyword after you GUI window has opened. Use the AddNode modify 
  3163. command instead.
  3164.  
  3165. selected=number (s=)
  3166.  
  3167.   The node is selected if number != 0 , unselected if number = 0. Defaults to 
  3168. unselected.
  3169.  
  3170.  
  3171.   Set which choice is selected when the window opens. This is only for 
  3172. multiple select list browsers. Set selected in the Listbrowser definition for 
  3173. single select lists.
  3174.  
  3175. GadgetText="[^|¶]text0|[^|¶]text1|[^|¶]text..." (gt=)
  3176.  
  3177.  Set the text(s). This parameter MUST be given. YOU MUST NOT GIVE MORE TEXTS 
  3178. THAN THE AMOUNT OF COLUMNS IN THE LISTBROWSER. A leading '^' makes the text 
  3179. editable. A leading '¶' (ALT p) uses the last defined image for the column 
  3180. rather than text. Note that images used in browsernodes can not be more than 
  3181. 255 pixels high. (hint: split larger images and use more than one node)
  3182.  
  3183. NOTE: the following parameters may only be used if the ListBrowser containing 
  3184. the node allows parenting.
  3185.  
  3186. defnumber=number  (defn=)
  3187.  
  3188.  Set the Generation of this browser node.
  3189.  
  3190. browsernodeparent  (bnp)
  3191.  
  3192.  This browser node has children.
  3193.  
  3194. Definition Reply
  3195. -----------------
  3196.  
  3197.  When the node creation is successful the pipe replies with
  3198.  
  3199. 'ok GID'
  3200.  
  3201. BrowserNode gadget modify parameters.
  3202. -------------------------------------
  3203.  
  3204. GadgetText="[^|¶]text0|[^|¶]text1|[^|¶]text..." (gt=)
  3205.  
  3206.  Set the text(s). YOU MUST NOT GIVE MORE TEXTS THAN THE AMOUNT OF COLUMNS IN 
  3207. THE LISTBROWSER. A leading '^' makes the text editable. A leading '¶' (ALT p) 
  3208. uses the last defined image for the column rather than text. Note that images 
  3209. used in browsernodes can not be more than 255 pixels high. (hint: split 
  3210. larger images and use more than one node)
  3211.  
  3212. removenode (remn)
  3213.  
  3214.  remove this browsernode from its ListBrowser
  3215.  
  3216. selected=number (s=)
  3217.  
  3218.   The node is selected if number != 0 , unselected if number = 0. This is 
  3219. only for nodes in multi select listbrowsers, for single select browsers see 
  3220. the listbrowser modify docs.
  3221.  
  3222. read
  3223. sort=COLUMN#
  3224.  
  3225.  To read a browser node you must also specify a column. The text contents of
  3226. that column are returned.
  3227.  
  3228. refresh (ref)
  3229.  
  3230.  
  3231. ------------------------------------------------------------------------------
  3232.                                  4.2.4.5 Menu                                 
  3233. ------------------------------------------------------------------------------
  3234.  
  3235. Menu gadget event
  3236. -------------------------
  3237.  
  3238. 'menu menu_number item_number sub_item_number checked'
  3239.  
  3240. checked=0 Item is not checked
  3241. checked=1 Item is checked
  3242.  
  3243. Menu gadget parameters.
  3244. -------------------------
  3245.  
  3246. gadgettext="menudata"  (gt=)
  3247.  
  3248. This text defines a menu for the CA window. The data is the following format.
  3249.  
  3250. menu_title|menu_item0|menu_item1 ...
  3251.  
  3252. Each menu_item is the following format
  3253.  
  3254. [@hotkey][$][-][^][%][&][!][`][#HEX_number#]menu_item_title
  3255.  
  3256. @ = hotkey for menu, following character is hotkey.
  3257. $ =  sub Item (of previous menu_item)
  3258. - =  Display a separator bar (ignore text and other options for this item )
  3259. ^ =  menu toggle
  3260. % =  menu checkable (unchecked at startup)
  3261. & =  menu checkable (checked at startup)
  3262. ! =  highlight none
  3263. ` =  disabled
  3264. # =  mutual exclude. Note the trailing '#' MUST be used.
  3265. If multiple flags are set they MUST be in the order shown.
  3266.  
  3267. Note: '`' is the only flag that may be set for the menu title.
  3268. Note: Separator bars are considered a menu item. Example
  3269.  
  3270. gt="dothis|-|dothat"
  3271. dothis is item 0, the bar is item 1, dothat is item 2.
  3272.  
  3273. replace=GID
  3274.  
  3275.  Use this menu to replace an existing menu specified by GID.
  3276.  
  3277. Menu gadget modify parameters.
  3278. -------------------------
  3279.  
  3280. disable=number (dis=)
  3281.  
  3282.  The menu or menu item is enabled if number = 0 , disabled if number != 0.
  3283.  
  3284. selected=number (s=)
  3285.  
  3286.   The menu item is checked if number != 0 , unchecked if number = 0. Ignored 
  3287. if a target is not specified.
  3288.  
  3289. target=number  (tar=)
  3290.  
  3291.  If a target is specified you are modifying a menu item. If a target is not 
  3292. specified you are modifying the menu itself.
  3293.  
  3294. ------------------------------------------------------------------------------
  3295.                                 4.2.4.6 Arexx                                 
  3296. ------------------------------------------------------------------------------
  3297.  
  3298. Arexx event  stream
  3299. -------------------
  3300.  
  3301. Arexx events are handled differently than other types of events, be careful.
  3302.  
  3303. The events are as follows.
  3304.  
  3305.  
  3306. 'arexx FID textlength <newline> text'
  3307.  
  3308.     FID is the function ID number
  3309.  
  3310.     textlength is the length of the text after the newline character.
  3311.  
  3312.  
  3313. If modify is turned on, after each event you MUST write a single line to the 
  3314. pipe in the following format.
  3315.  
  3316. 'rc=number result="result text"'
  3317.  
  3318. If rc > 0 result is ignored, if RC is omitted it defaults to 0.
  3319.  
  3320.  The pipe replies with 'ok' to your result line (unless quiet is set).
  3321.  
  3322. If modify is not turned on all arexx events are given a rc of 0 (success) and 
  3323. a null result.
  3324.  
  3325. Arexx object parameters.
  3326. -------------------------
  3327.  
  3328. gadgettext="HOSTNAME|Function0|Function1|..."  (gt=)
  3329.  
  3330. The gadget text defines the arexx host name and the functions available. 
  3331. Hostname should be all capitals, function names should not contain spaces. 
  3332. The first function is FID 0, the second FID 1, ...
  3333.  
  3334. slot
  3335.  
  3336. This switch causes a slot number to appended to the host name. TESTHOST would 
  3337. become TESTHOST.1 or TESTHOST.2 etc.
  3338.  
  3339. Arexx definition Reply
  3340. ----------------------
  3341.  
  3342.  When the ARexx object creation is successful the pipe replies with
  3343.  
  3344. 'ok HOSTNAME'
  3345.  
  3346. NOTE only one arexx host can be defined for each GUI window.
  3347.  
  3348. Additional info
  3349. ---------------------
  3350.  
  3351. To have a arexx host with no GUI window, set the NoWindow switch in the 
  3352. window definition.  See the window docs for more information.
  3353.  
  3354. ------------------------------------------------------------------------------
  3355.                                  4.2.5 Fancy                                  
  3356. ------------------------------------------------------------------------------
  3357.  
  3358.  
  3359. ------------------------------------------------------------------------------
  3360.                                4.2.5.1 GetFile                                
  3361. ------------------------------------------------------------------------------
  3362.  
  3363. There are actually two file requesters available in AWNPipe. The 
  3364. ClassAct/Reaction getfile.gadget, and the ASL file requester. Only the 
  3365. getfile.gadget can be displayed in a gui. Both can be opened under your 
  3366. control to present the user with a file requester. The details for the ASL 
  3367. requester are at the end of this file.
  3368.  
  3369.   *** GETFILE GADGET CLASS ***
  3370.  
  3371. GetFile gadget event.
  3372. -------------------------
  3373.  
  3374. 'gadget GID  success ["filename" ["filename" ...]]'
  3375.  
  3376.  Success=0 user selected no file or canceled.
  3377.  Success!=0 user selected a file.
  3378. Filenames are fully qualified with path.
  3379.  
  3380. GetFile gadget parameters.
  3381. -------------------------
  3382.  
  3383. font=GID
  3384.  
  3385. This sets the font for the gadget. The GID points to an ALREADY defined text 
  3386. attribute.
  3387.  
  3388.  
  3389. readonly (ro)
  3390.  
  3391.  This gadget is read only.
  3392.  
  3393. disable=number (dis=)
  3394.  
  3395.  The gadget is enabled if number = 0 , disabled if number != 0. Defaults to 
  3396. enabled.
  3397.  
  3398. gadgettext="file requester title" (gt=)
  3399.  
  3400.  Set the title of the file requester.
  3401.  
  3402. pattern="pattern" (pat=)
  3403.  
  3404.  Set and Enable pattern matching in the file.
  3405.  
  3406. multi  (m)
  3407.  
  3408.  Allow multi selection in the file requester. (does not seem to work)
  3409.  
  3410. save
  3411.  
  3412.  This is a save requester.
  3413.  
  3414. drawers (dr)
  3415.  
  3416.  Only show and allow selections of drawers.
  3417.  
  3418. icons (i)
  3419.  
  3420.  Do NOT show .info files.
  3421.  
  3422. filename="path:filename" (fn=)
  3423.  
  3424.  Set the filename and directory for the file requester. It must end in a '/' 
  3425. for drawer only file requesters
  3426.  
  3427. Wide=num
  3428. High=num
  3429.  
  3430.  Set the size of the requester when opened.
  3431.  
  3432. unattached    (ua)
  3433.  
  3434.  This file requester is not attached to the CA window. It may still be 
  3435. activated in the modify conversation.
  3436.  
  3437. minwidth=number (minw=)
  3438.  
  3439.  Set the minimum width for this gadget
  3440.  
  3441. minheight=number (minh=)
  3442.  
  3443.  Set the minimum height for this gadget
  3444.  
  3445. weightedwidth=number (weiw=)
  3446.  
  3447.  Set the weighted width for this gadget
  3448.  
  3449. weightedheight=number (weih=)
  3450.  
  3451.  Set the weighted height for this gadget
  3452.  
  3453. nominalsize (noms)
  3454.  
  3455.  Set this gadget to its nominal size.
  3456.  
  3457. tags="tags|data[|tag|data...]|0
  3458.  
  3459.  A list of tag and value pairs in HEX. Do not forget the trailing null !
  3460.  
  3461. childlabel    (chl)
  3462. childlabelr   (chlr)
  3463.  
  3464.  Use the previously defined image as a childlabel for this gadget. Display 
  3465. the childlabel to the right or left of the gadget.
  3466.  
  3467. replace=GID
  3468.  
  3469.  Use this gadget to replace an existing gadget specified by GID.
  3470.  
  3471. Definition Reply
  3472. -----------------
  3473.  
  3474.  When the gadget creation is successful the pipe replies
  3475. with
  3476.  
  3477. 'ok GID'
  3478.  
  3479. GetFile gadget modify parameters.
  3480. -------------------------
  3481.  
  3482. selected=number (sel=)
  3483.  
  3484. THIS ONLY WORKS FOR UNATTACHED GETFILE GADGETS.
  3485. Number is ignored but must be given. This opens the file requester and the 
  3486. selected files are returned rather than a simple ok.
  3487. You should not use other modify instructions on the same line as 'selected'.
  3488.  
  3489. disable=number (dis=)
  3490.  
  3491.  The gadget is enabled if number = 0 , disabled if number != 0.
  3492.  
  3493. save=number
  3494.  
  3495.  If number=0 this is NOT a save requester. If number~=0 this is a save 
  3496. requester.
  3497.  
  3498. filename="path:filename" (fn=)
  3499.  
  3500.  Set the filename and directory for the file requester.
  3501.  
  3502. gadgettext="title" (gt=)
  3503.  
  3504.  Set the file requesters title.
  3505.  
  3506.  
  3507.   *** GETFILE ASL ***
  3508.  
  3509. The ASL requester does not send events.
  3510.  
  3511. GetFile ASL parameters.
  3512. -------------------------
  3513.  
  3514. ASL
  3515.  
  3516.   This tells AWNP you want to define an ASL file requester.
  3517.  
  3518. font=GID
  3519.  
  3520. This sets the font for the gadget. The GID points to an ALREADY defined text 
  3521. attribute.
  3522.  
  3523.  
  3524. gadgettext="file requester title" (gt=)
  3525.  
  3526.  Set the title of the file requester.
  3527.  
  3528. pattern="pattern" (pat=)
  3529.  
  3530.  Set and Enable pattern matching in the file.
  3531.  
  3532. multi  (m)
  3533.  
  3534.  Allow multi selection in the file requester. (does not seem to work)
  3535.  
  3536. save
  3537.  
  3538.  This is a save requester.
  3539.  
  3540. drawers (dr)
  3541.  
  3542.  Only show and allow selections of drawers.
  3543.  
  3544. icons (i)
  3545.  
  3546.  Do NOT show .info files.
  3547.  
  3548. filename="path:filename" (fn=)
  3549.  
  3550.  Set the filename and directory for the file requester. It must end in a '/' 
  3551. for drawer only file requesters
  3552.  
  3553. Wide=num
  3554. High=num
  3555.  
  3556.  Set the size of the requester when opened.
  3557.  
  3558. top=num
  3559. left=num
  3560.  
  3561.  Set the position of the requester when it opens.
  3562.  
  3563. postx="positive text"
  3564.  
  3565.  Set the text for the positive choice in the file requester. Defaults to OK.
  3566.  
  3567. negtx="negative text"
  3568.  
  3569.  Set the text for the positive choice in the file requester. Defaults to 
  3570. Cancel
  3571.  
  3572. Definition Reply
  3573. -----------------
  3574.  
  3575.  When the gadget creation is successful the pipe replies
  3576. with
  3577.  
  3578. 'ok GID'
  3579.  
  3580. GetFile ASL modify parameters.
  3581. -------------------------
  3582.  
  3583.  You can only modify the ASL getfile requester when opening it. Unless the 
  3584. selected keyword is present the modify line is ignored.
  3585.  
  3586.  
  3587. selected=number (sel=)
  3588.  
  3589. Number is ignored but must be given. This opens the file requester and you 
  3590. get returned the following line rather than a simple ok.
  3591.  
  3592. SUCCESS "path:drawer/filename" "path2:drawer2/filename2"  ...
  3593.  
  3594. SUCCESS=0 if the user aborted the file requester without making a selection. 
  3595. SUCCESS !=0 if the user selected a file, each file name is quoted and all are 
  3596. on a single line.
  3597.  
  3598. save=number
  3599.  
  3600.  If number=0 this is NOT a save requester. If number~=0 this is a save 
  3601. requester.
  3602.  
  3603. filename="path:filename" (fn=)
  3604.  
  3605.  Set the filename and directory for the file requester.
  3606.  
  3607. gadgettext="title" (gt=)
  3608.  
  3609.  Set the file requesters title.
  3610.  
  3611. Wide=num
  3612. High=num
  3613.  
  3614.  Set the size of the requester when opened.
  3615.  
  3616. top=num
  3617. left=num
  3618.  
  3619.  Set the position of the requester when it opens.
  3620.  
  3621. postx="positive text"
  3622.  
  3623.  Set the text for the positive choice in the file requester. Defaults to OK.
  3624.  
  3625. negtx="negative text"
  3626.  
  3627.  Set the text for the positive choice in the file requester. Defaults to 
  3628. Cancel
  3629.  
  3630.  
  3631. ------------------------------------------------------------------------------
  3632.                                4.2.5.2 GetFont                                
  3633. ------------------------------------------------------------------------------
  3634.  
  3635. GetFont gadget event.
  3636. -------------------------
  3637.  
  3638. 'gadget GID  success fontname fontsize fontstyle fontflags'
  3639.  
  3640.  Success=0 user selected no font or canceled. Success!=0 user selected a 
  3641. font.
  3642.  
  3643. GetFont gadget parameters.
  3644. -------------------------
  3645.  
  3646. font=GID
  3647.  
  3648. This sets the font for the gadgets text. The GID points to an ALREADY defined 
  3649. text attribute.
  3650.  
  3651. close (c)
  3652.  
  3653.  This gadget will close the window when selected by the user.
  3654.  
  3655. readonly (ro)
  3656.  
  3657.  This gadget is read only.
  3658.  
  3659. disable=number (dis=)
  3660.  
  3661.  The gadget is enabled if number = 0 , disabled if number != 0. Defaults to 
  3662. enabled.
  3663.  
  3664. gadgettext="font requester title" (gt=)
  3665.  
  3666.  Set the title of the file requester.
  3667.  
  3668. style
  3669.  
  3670.  This requester includes style settings.
  3671.  
  3672. fixed
  3673.  
  3674.  This requester includes fixed width fonts only.
  3675.  
  3676. Minn=num
  3677. Maxn=num
  3678.  
  3679. The minimum and maximum font size allowed. Defaults to 6-20
  3680.  
  3681. Wide=num
  3682. High=num
  3683.  
  3684.  Set the size of the requester when opened.
  3685.  
  3686. unattached    (ua)
  3687.  
  3688.  This file requester is not attached to the CA window. It may still be 
  3689. activated in the modify conversation.
  3690.  
  3691. minwidth=number (minw=)
  3692.  
  3693.  Set the minimum width for this gadget
  3694.  
  3695. minheight=number (minh=)
  3696.  
  3697.  Set the minimum height for this gadget
  3698.  
  3699. weightedwidth=number (weiw=)
  3700.  
  3701.  Set the weighted width for this gadget
  3702.  
  3703. weightedheight=number (weih=)
  3704.  
  3705.  Set the weighted height for this gadget
  3706.  
  3707. nominalsize (noms)
  3708.  
  3709.  Set this gadget to its nominal size.
  3710.  
  3711. tags="tags|data[|tag|data...]|0
  3712.  
  3713.  A list of tag and value pairs in HEX. Do not forget the trailing null !
  3714.  
  3715. childlabel    (chl) childlabelr   (chlr)
  3716.  
  3717.  Use the previously defined image as a childlabel for this gadget. Display 
  3718. the childlabel to the right or left of the gadget.
  3719.  
  3720. replace=GID
  3721.  
  3722.  Use this gadget to replace an existing gadget specified by GID.
  3723.  
  3724. Definition Reply
  3725. -----------------
  3726.  
  3727.  When the gadget creation is successful the pipe replies
  3728. with
  3729.  
  3730. 'ok GID'
  3731.  
  3732. GetFont gadget modify parameters.
  3733. -------------------------
  3734.  
  3735. selected=number (sel=)
  3736.  
  3737. Number is ignored but must be given. This opens the font requester and the 
  3738. selected font is returned rather than a simple ok.
  3739.  
  3740. disable=number (dis=)
  3741.  
  3742.  The gadget is enabled if number = 0 , disabled if number != 0.
  3743.  
  3744. ------------------------------------------------------------------------------
  3745.                               4.2.5.3 TextEditor                              
  3746. ------------------------------------------------------------------------------
  3747.  
  3748. The TextEditor.gadget is only available under ADOS 3.5 . At this time only
  3749. beta versions were available but the TextEditor gadget is so great it had to
  3750. be included in AWNPipe. These functions should all work once it is released.
  3751.  
  3752.  
  3753.  TextEditor gadget event.
  3754. -------------------------
  3755. An event is only generated when the user double clicks the gadget.
  3756.  
  3757. 'gadget GID DoubleClickPositionX DoubleClickPositionY'
  3758.  
  3759. DoubleClickPositionX/Y is the position in the current line the user double 
  3760. clicked.
  3761.  
  3762. NOTE: You must the TextEditor directly at appropriate times in your program. 
  3763. This means you should have modify turned on if the TextEditor gadget is not 
  3764. read only.
  3765.  
  3766.  
  3767. TextEditor gadget parameters.
  3768. -------------------------
  3769.  
  3770. font=GID
  3771.  
  3772. This sets the font for the gadget. The GID points to an ALREADY defined text 
  3773. attribute.
  3774.  
  3775. arrows (a)
  3776.  
  3777.  Give the TextEditor a scroll gadget on the right.
  3778.  
  3779. readonly (ro)
  3780.  
  3781.  This gadget is read only.
  3782.  
  3783. disable=number (dis=)
  3784.  
  3785.  The gadget is enabled if number = 0 , disabled if number != 0. Defaults to 
  3786. enabled.
  3787.  
  3788. export="num"
  3789.  
  3790.  Set the export hook for the TextEditor.
  3791.  
  3792. num=0  Plain text hook
  3793. num=1  EMail hook
  3794.  
  3795. import="num"
  3796.  
  3797.  Set the import hook for the TextEditor.
  3798.  
  3799. num=0  Plain text hook
  3800. num=1  EMail hook
  3801. num=2  Mime hook
  3802. num=3  Mime quoted hook
  3803.  
  3804. block
  3805.  
  3806.  The texteditor should mark a block of text as well as generate an event when 
  3807. it is double clicked.
  3808.  
  3809. gadgettext="text" (gt=)
  3810.  
  3811.  Set the text in the gadget.
  3812. given.
  3813.  
  3814. bindata (bd)
  3815.  
  3816. The text will be passed to this pipe in binary after the command line. The 
  3817. gadgettext parameter now gives the length of the data. Setting datain means 
  3818. the data is read from an external file rather than the pipe.
  3819.  
  3820. datain="filename" (di=)
  3821.  
  3822.  Read the data for this gadget from a file.
  3823. It is ignored if the Bindata keyword is not present. A length of 0 means to 
  3824. use the complete file.
  3825.  
  3826. minwidth=number (minw=)
  3827.  
  3828.  Set the minimum width for this gadget
  3829.  
  3830. minheight=number (minh=)
  3831.  
  3832.  Set the minimum height for this gadget
  3833.  
  3834. weightedwidth=number (weiw=)
  3835.  
  3836.  Set the weighted width for this gadget
  3837.  
  3838. weightedheight=number (weih=)
  3839.  
  3840.  Set the weighted height for this gadget
  3841.  
  3842. nominalsize (noms)
  3843.  
  3844.  Set this gadget to its nominal size.
  3845.  
  3846. replace=GID
  3847.  
  3848.  Use this gadget to replace an existing gadget specified by GID.
  3849.  
  3850. Fixed
  3851.  
  3852.  Use a fixed font for this TextEditor.
  3853.  
  3854. Definition Reply
  3855. -----------------
  3856.  
  3857.  When the gadget creation is successful the pipe replies with
  3858.  
  3859. 'ok GID'
  3860.  
  3861. TextEditor gadget modify parameters.
  3862. -------------------------
  3863. read
  3864.  
  3865.  This should not be used with any other parameters. It is ALWAYS responded to 
  3866. with 'SIZE<newline>CHARACTERS'.
  3867.  
  3868. SIZE is the number or characters after the newline. The characters are the 
  3869. current contents of the TextEditor gadget.
  3870.  
  3871. info
  3872.  
  3873.  This should not be used with any other parameters. It is ALWAYS responded to 
  3874. with
  3875. 'CURSORX CURSORY BLOCKMARKED [BSTARTX BSTARTY BENDX BENDY]'.
  3876.  
  3877. CURSORX and CURSORY are the current cursor location, BLOCKMARKED=0 if no 
  3878. block is marked, BLOCKMARKED~=0 means a block is currently marked. BSTARTX/Y 
  3879. and BENDX/Y (the start and end of the marked block) are only given if 
  3880. BLOCKMARKED!=0.
  3881.  
  3882. update=number
  3883.  
  3884. If number=0 then turn off updating of the Texteditor gadget. If number!=0 
  3885. then turn updating of the gadget back on.
  3886.  
  3887. disable=number (dis=)
  3888.  
  3889.  The gadget is enabled if number = 0 , disabled if number != 0.
  3890.  
  3891. readonly=num (ro=)
  3892.  
  3893.  if num != 0 then this gadget is read only. If num =0 then the gadget is NOT
  3894. readonly.
  3895.  
  3896. clear
  3897.  
  3898.  Remove all text from the TextEditor gadget.
  3899.  
  3900. CursorY="num" (cy=)
  3901.  
  3902.  Set the cursor to Y position to num.
  3903.  
  3904. Cursorx="num" (cx=)
  3905.  
  3906.  Set the cursor to Y position to num.
  3907.  
  3908. command="string" (cmd=)
  3909.  
  3910.  Have the TextEditor gadget execute the Arexx command given in string.Command 
  3911. should not be used with other modify parameters.
  3912.  
  3913.  Command always replies with 'ok SUCCESS [SIZE] <newline>[CHARACTERS]'
  3914.  if SUCCESS!=0 then the command was handled by the TextEditor, if SUCCESS=0 
  3915. then the command was not recognised.
  3916.  If the command succeeds you MUST check to see if SIZE is given. If size is 
  3917. specified you then read SIZE  the number or characters after the newline. 
  3918. This is data returned by the command to the TextEditor.
  3919.  
  3920. replace
  3921.  
  3922.  Replace the text highlighted with the text given in gadgettext.
  3923.  
  3924. Replace ALWAYS responds with 'RESULT' where result=0 if a marked string is 
  3925. not found, and RESULT !=0 if the replace is successful.
  3926.  
  3927. search
  3928.  
  3929.  Search for the text given in gadgettext.
  3930.  
  3931. Search ALWAYS responds with 'RESULT' where result=0 if the search string is 
  3932. not found, and RESULT !=0 if the search string is found.
  3933.  
  3934. gadgettext="text" (gt=)
  3935.  
  3936.  Insert the text in the gadget. OR text to search for if search parameter is 
  3937. specified, OR text to replace highlighted text with if replace is specified.
  3938.  
  3939. target="num" (tar=)
  3940.  
  3941.  If num=0 insert text at start of current contents. If num!=0 then insert 
  3942. text at the cursor position. If target is not specified the text is inserted 
  3943. at the end of the current contents.
  3944. If target is not given insert text at cursor position (default).
  3945.  
  3946.   OR
  3947.  
  3948. With search, num is a bit field for search modifiers.
  3949.  
  3950. bit 0 (1)  search from top
  3951. bit 1 (2)  search next (default)
  3952. bit 2 (4)  search case sensitive
  3953. bit 3 (8)  search dospattern
  3954. bit 4 (16)  search backwards
  3955.  
  3956. Unfortunately this is implemented as a decimal number. See the 'Hints' 
  3957. section for easy ways to handle this.
  3958.  
  3959. bindata (bd)
  3960.  
  3961. The text will be passed to this pipe in binary after the command line. The 
  3962. gadgettext parameter now gives the length of the data. Note that you can NOT 
  3963. use datain during modify.
  3964.  
  3965. Search responds with 'ok RESULT' where result=0 if the search string is not 
  3966. found, and RESULT !=0 if the search string is found.
  3967.  
  3968. ------------------------------------------------------------------------------
  3969.                               4.2.5.4 TextFeild                               
  3970. ------------------------------------------------------------------------------
  3971.  
  3972. TextField gadget event.
  3973. -------------------------
  3974. NOTE: The textfield gadget has two event forms. For more information see the 
  3975. shortevent parameter below
  3976.  
  3977. Short Event
  3978. 'gadget GID'
  3979.  
  3980. or Default event.
  3981. 'gadget GID size <newline> characters[size]'
  3982.  
  3983. The next 'size' number of characters after the newline are the contents of 
  3984. the TextField gadget.
  3985.  
  3986. Textfield gadget parameters.
  3987. -------------------------
  3988.  
  3989. font=GID
  3990.  
  3991. This sets the font for the gadget. The GID points to an ALREADY defined text 
  3992. attribute.
  3993.  
  3994. arrows (a)
  3995.  
  3996.  Give the textfield a scroll gadget on the right.
  3997.  
  3998. readonly (ro)
  3999.  
  4000.  This gadget is read only.
  4001.  
  4002. disable=number (dis=)
  4003.  
  4004.  The gadget is enabled if number = 0 , disabled if number != 0. Defaults to 
  4005. enabled.
  4006.  
  4007. TabCycle (tc)
  4008.  
  4009.  This gadget can be activated using the tab key.
  4010.  
  4011. gadgettext="text" (gt=)
  4012.  
  4013.  Set the text in the gadget.
  4014.  
  4015. bindata (bd)
  4016.  
  4017. The text will be passed to this pipe in binary after the command line. The 
  4018. gadgettext parameter now gives the length of the data. Setting datain means 
  4019. the data is read from an external file rather than the pipe.
  4020.  
  4021. datain="filename" (di=)
  4022.  
  4023.  Read the data for this gadget from a file.
  4024. It is ignored if the Bindata keyword is not present. A length of 0 means to 
  4025. use the complete file.
  4026.  
  4027. shortevent  (se)
  4028.  
  4029.  The events sent by the textfield gadget do not include the contents of the 
  4030. textfield. This parameter only works if modify is turned on.Also see events 
  4031. above.
  4032.  
  4033.  
  4034. centerjustify  (cj)
  4035. rightjustify   (rj)
  4036.  
  4037.  Set the justification of the text for the gadget. Defaults to leftjustify.
  4038.  
  4039. bevel=TYPE  (b=)
  4040.  
  4041.  Set the bevel type for this gadget.
  4042.  
  4043. 0=NONE
  4044. 1=THIN
  4045. 2=BUTTON
  4046. 3=GROUP
  4047. 4=FIELD
  4048. 5=DROPBOX
  4049. 6=SBAR_HORIZ
  4050. 7=SBAR_VERT
  4051. 8=BOX
  4052. 9=STANDARD
  4053.  
  4054.  
  4055. minwidth=number (minw=)
  4056.  
  4057.  Set the minimum width for this gadget
  4058.  
  4059. minheight=number (minh=)
  4060.  
  4061.  Set the minimum height for this gadget
  4062.  
  4063. weightedwidth=number (weiw=)
  4064.  
  4065.  Set the weighted width for this gadget
  4066.  
  4067. weightedheight=number (weih=)
  4068.  
  4069.  Set the weighted height for this gadget
  4070.  
  4071. nominalsize (noms)
  4072.  
  4073.  Set this gadget to its nominal size.
  4074.  
  4075. replace=GID
  4076.  
  4077.  Use this gadget to replace an existing gadget specified by GID.
  4078.  
  4079. Definition Reply
  4080. -----------------
  4081.  
  4082.  When the gadget creation is successful the pipe replies with
  4083.  
  4084. 'ok GID'
  4085.  
  4086. Textfield gadget modify parameters.
  4087. -------------------------
  4088. disable=number (dis=)
  4089.  
  4090.  The gadget is enabled if number = 0 , disabled if number != 0.
  4091.  
  4092. gadgettext="text" (gt=)
  4093.  
  4094.  Set the text in the gadget to text if scroll keyword is not used. Else 
  4095. insert the text at the position set by scroll.
  4096.  
  4097. scroll="num"
  4098.  
  4099.  Set the cursor to position num.
  4100.  
  4101. delete=num
  4102.  
  4103.  Delete num of characters from the cursor forward.
  4104.  
  4105. bindata (bd)
  4106.  
  4107. The text will be passed to this pipe in binary after the command line. The 
  4108. gadgettext parameter now gives the length of the data. Note that you can NOT 
  4109. use datain during modify.
  4110.  
  4111. All modifications of a textfield (except a lone disable) are responded to by 
  4112. 'ok POSITION' where POSITION is the final curser position.
  4113.  
  4114. ------------------------------------------------------------------------------
  4115.                              4.2.5.5 ListBrowser                              
  4116. ------------------------------------------------------------------------------
  4117.  
  4118. ListBrowser gadget event
  4119. -------------------------
  4120.  
  4121. 'gadget GID event_source event_column NodeGID [NodeGID [NodeGID ...]]'
  4122.  
  4123. event_source&1 means normal selection of node.
  4124.  
  4125. event_source&2 means this nodes children have been hidden.
  4126.  
  4127. event_source&4 means this nodes children are now shown.
  4128.  
  4129. event_source&8 means node has been edited.
  4130.  
  4131. event_source&16 means double click on node.
  4132.  
  4133. event_column is the column the mouse was over when the node was clicked.
  4134.  
  4135. ListBrowser gadget parameters.
  4136. -------------------------
  4137.  
  4138. font=GID
  4139.  
  4140. This sets the font for the gadget. The GID points to an ALREADY defined text 
  4141. attribute.
  4142.  
  4143. readonly (ro)
  4144.  
  4145.  This list browser entries can not be edited.
  4146.  
  4147. disable=number (dis=)
  4148.  
  4149.  The gadget is enabled if number = 0 , disabled if number != 0. Defaults to 
  4150. enabled.
  4151.  
  4152. selected=number (s=)
  4153.  
  4154.   Set which choice is selected when the window opens. Selections start at 0 . 
  4155. This defaults to none. CAREFUL modify uses the listnode GID, this parameter 
  4156. uses the ordinal position of the node.
  4157.  
  4158. ListbrowserLabels="text0|text1|text..."  (lbl=)
  4159.  
  4160.  Set the column labels for the list. Defaults to 1 unlabeled column.  NO MORE 
  4161. THAN 20 COLUMNS can be defined !
  4162.  
  4163. bnparent (bnp)
  4164.  
  4165.  Allow parenting in this listbrowser.
  4166.  
  4167. showtitles (st)
  4168.  
  4169.  Show the column tiles of this listbrowser.
  4170.  
  4171. vertical (v)
  4172.  
  4173.  Use vertical separators in the listbrowser.
  4174.  
  4175. hori (h)
  4176.  
  4177.  Use horizontal separators in the listbrowser.
  4178.  
  4179. arrows   (a)
  4180.  
  4181.  Show arrows for horizontal scrolling and make this a virtual width list.
  4182.  
  4183. multi  (m)
  4184.  
  4185.  Switch to allow multi selection in the list. Multi select by holding the 
  4186. shift key.
  4187.  
  4188. minwidth=number (minw=)
  4189.  
  4190.  Set the minimum width for this gadget
  4191.  
  4192. minheight=number (minh=)
  4193.  
  4194.  Set the minimum height for this gadget
  4195.  
  4196. weightedwidth=number (weiw=)
  4197.  
  4198.  Set the weighted width for this gadget
  4199.  
  4200. weightedheight=number (weih=)
  4201.  
  4202.  Set the weighted height for this gadget
  4203.  
  4204. nominalsize (noms)
  4205.  
  4206.  Set this gadget to its nominal size.
  4207.  
  4208. SPECIAL FUNCTION
  4209. -----------------
  4210.  
  4211.  Using sort on a line BY ITSELF during gadget definitions will cause the last 
  4212. defined listbrowser to be sorted. This is to allow a list browser to be 
  4213. sorted before the gui window is opened. (the modify sort command sorts the 
  4214. listbrowser after the window is opened.)
  4215.  
  4216. sort=COLUMN#
  4217.  
  4218. (optional) sort=COLUMN# defn=COLUMN#
  4219.  
  4220.  Sort list browser based on the column number, if the sort entries are the 
  4221. save a secondary sort based on the defaultnumber column is done. Specifying a 
  4222. secondary column to sort by is optional. Remember columns start at 0. You 
  4223. MUST NOT specify an invalid column number.
  4224.  
  4225. Definition Reply
  4226. -----------------
  4227.  
  4228.  When the gadget creation is successful the pipe replies with
  4229.  
  4230. 'ok GID'
  4231.  
  4232. ListBrowser gadget modify parameters.
  4233. -------------------------
  4234. down
  4235.  
  4236. Select the next node in the list.
  4237.  
  4238. up
  4239.  
  4240. Select the previous node in the list.
  4241.  
  4242. addnode (addn)
  4243.  
  4244.  Add a new node to this ListBrowser.
  4245.  
  4246.  You should keep this modify command a s simple as possible, only use 
  4247. keywords that specifically deal with the creation of the node. (tar gt bnp 
  4248. defn sc )
  4249.  
  4250.  Put additional changes like select= or disable = in a separate modify line. 
  4251. Some keywords like refresh, tick, disable, sort, and others could cause extra 
  4252. 'oks' to be in the response line.
  4253.  
  4254.  Keep it simple and this modify command is responded to with 'ok GID' where 
  4255. GID is the ID of the browser node.
  4256.  
  4257. GadgetText="[^|¶]text0|[^|¶]text1|[^|¶]text..." (gt=)
  4258.  
  4259.  Set the text(s) for the added node. This parameter MUST be given if you are 
  4260. using 'addnode' . YOU MUST NOT GIVE MORE TEXTS THAN THE AMOUNT OF COLUMNS IN 
  4261. THE LISTBROWSER. A leading '^' makes the text editable. A leading '¶' (ALT p) 
  4262. uses the last defined image for the column rather than text. Note that images 
  4263. used in browsernodes can not be more than 255 pixels high. (hint: split 
  4264. larger images and use more than one node)
  4265.  
  4266. defnumber=number  (defn=)
  4267.  
  4268.  Set the Generation of this browser node.
  4269.  
  4270. target=GID  (tar=)
  4271.  
  4272.  If GID=0 add the new node at head of list. If GID=-1 add the new node at 
  4273. tail of list. Else add the new node immediately after the node specified by 
  4274. GID.
  4275.  
  4276. browsernodeparent  (bnp)
  4277.  
  4278.  The new browser node has children.
  4279.  
  4280. List=number
  4281.  
  4282.  If number=0 detach the node list from the listbrowser. If number!=0 then 
  4283. reattaches the node list to the listbrowser.
  4284.  
  4285. removenode (remn)
  4286.  
  4287.  Remove ALL browsernodes from this ListBrowser.
  4288.  
  4289. readonly (ro)
  4290.  
  4291.  This list browser entries can not be edited.
  4292.  
  4293. disable=number (dis=)
  4294.  
  4295.  The gadget is enabled if number = 0 , disabled if number != 0.
  4296.  
  4297. scroll=GID (scr=)
  4298.  
  4299.  Scroll the listbrowser so the node specified by GID is at the top.
  4300.  
  4301. selected=num (s=)
  4302.  
  4303.   For multi select lists
  4304.  
  4305.  Setting selected=0 sets all nodes as unselected. Setting selected=-1 sets 
  4306. all nodes as selected.  You may set the nodes individually instead of using 
  4307. this command. See browsernode modify commands.
  4308.  
  4309. selected=node_GID (s=)
  4310.  
  4311.   For single select lists
  4312.  
  4313.  Set the selected node. Selected=0 sets all nodes as unselected, else the 
  4314. specified node is selected. CAREFUL modify uses the listnode GID not the 
  4315. ordinal position. This is different then in the listbrowser definition.
  4316.  
  4317. sort=COLUMN#
  4318.  
  4319. (optional) sort=COLUMN# defn=COLUMN#
  4320.  
  4321.  Sort list browser based on the column number, if the sort entries are the 
  4322. save a secondary sort based on the defaultnumber column is done. Specifying a 
  4323. secondary column to sort by is optional. Remember columns start at 0. You 
  4324. MUST NOT specify an invalid column number.
  4325.  
  4326. autofit
  4327.  
  4328.  This keyword forces the listbrowser to evaluate its size. It is only needed 
  4329. when a listbrowser uses a font other than the screen default font AND no new 
  4330. browser nodes are added after the GUI window is opened.
  4331.  
  4332. order
  4333.  
  4334.  Read the order of nodes in the listbrowser. This does not return the normal 
  4335. 'ok' instead it returns a sequence of GID's in the same order as the nodes in 
  4336. the listbrowser. THIS COMMAND SHOULD NOT BE USED WITH ANY OTHER MODIFY 
  4337. COMMANDS ON THE SAME LINE.
  4338.  
  4339.  
  4340.  
  4341. ------------------------------------------------------------------------------
  4342.                                4.2.5.6 Palette                                
  4343. ------------------------------------------------------------------------------
  4344.  
  4345. palette gadget event
  4346. -------------------------
  4347.  
  4348. 'gadget GID selected_color'
  4349.  
  4350. Palette gadget parameters.
  4351. -------------------------
  4352.  
  4353. font=GID
  4354.  
  4355. This sets the font for the gadget. The GID points to an ALREADY defined text 
  4356. attribute.
  4357.  
  4358. close (c)
  4359.  
  4360.  This gadget will close the window when selected by the user.
  4361.  
  4362. readonly (ro)
  4363.  
  4364.  This gadget is read only.
  4365.  
  4366. disable=number (dis=)
  4367.  
  4368.  The gadget is enabled if number = 0 , disabled if number != 0. Defaults to 
  4369. enabled.
  4370.  
  4371. minnumber=number (minn=)
  4372.  
  4373.  The first color to display in this gadget. Defaults to 0.
  4374.  
  4375. maxnumber=number (maxn=)
  4376.  
  4377.  How many colors to display in this gadget. Defaults to 8.
  4378.  
  4379. selected=number (s=)
  4380.  
  4381.  Color selected when window is opened. Defaults to 0.
  4382.  
  4383. minwidth=number (minw=)
  4384.  
  4385.  Set the minimum width for this gadget
  4386.  
  4387. minheight=number (minh=)
  4388.  
  4389.  Set the minimum height for this gadget
  4390.  
  4391. weightedwidth=number (weiw=)
  4392.  
  4393.  Set the weighted width for this gadget
  4394.  
  4395. weightedheight=number (weih=)
  4396.  
  4397.  Set the weighted height for this gadget
  4398.  
  4399. nominalsize (noms)
  4400.  
  4401.  Set this gadget to its nominal size.
  4402.  
  4403. replace=GID
  4404.  
  4405.  Use this gadget to replace an existing gadget specified by GID.
  4406.  
  4407. Definition Reply
  4408. -----------------
  4409.  
  4410.  When the gadget creation is successful the pipe replies with
  4411.  
  4412. 'ok GID'
  4413.  
  4414. Palette gadget modify parameters.
  4415. -------------------------
  4416.  
  4417. disable=number (dis=)
  4418.  
  4419.  The gadget is enabled if number = 0 , disabled if number != 0.
  4420.  
  4421. selected=number (s=)
  4422.  
  4423.  Set the color selected in the gadget
  4424.  
  4425.  
  4426. ------------------------------------------------------------------------------
  4427.                                   4.2.6 More                                  
  4428. ------------------------------------------------------------------------------
  4429.  
  4430.  
  4431. ------------------------------------------------------------------------------
  4432.                               4.2.6.1 Fuelgauge                               
  4433. ------------------------------------------------------------------------------
  4434.  
  4435.  
  4436. The Fuel gauge do not produce events.
  4437.  
  4438.  
  4439. FuelGauge gadget parameters.
  4440. -------------------------
  4441.  
  4442. font=GID
  4443.  
  4444. This sets the font for the gadget. The GID points to an ALREADY defined text 
  4445. attribute.
  4446.  
  4447. close (c)
  4448.  
  4449.  This gadget will close the window when selected by the user.
  4450.  
  4451. readonly (ro)
  4452.  
  4453.  This gadget is read only.
  4454.  
  4455. disable=number (dis=)
  4456.  
  4457.  The gadget is enabled if number = 0 , disabled if number !=0. Defaults to 
  4458. enabled.
  4459.  
  4460. gadgettext="text" (gt=)
  4461.  
  4462.  Set the text of the gadget.
  4463.  
  4464. centerjustify (cj)
  4465.  
  4466.  Set the justification of the text for the gadget. Defaults to leftjustify.
  4467.  
  4468. vertical   (v)
  4469.  
  4470.  This fuelgauge is vertical. Defaults to horizontal.
  4471.  
  4472. ticks=number (t=)
  4473.  
  4474.  Set the  'number' of ticks in the fuel gauge. Defaults to 11.
  4475.  
  4476. percent (per)
  4477.  
  4478.  Show the percentage full as the fuel gauge text.
  4479.  
  4480. minnumber=number (minn=)
  4481.  
  4482.  Empty value for this gadget. Defaults to 0.
  4483.  
  4484. maxnumber=number (maxn=)
  4485.  
  4486.  Full value for this gadget. Defaults to 100.
  4487.  
  4488. defnumber=number  (defn=)
  4489.  
  4490.  Value for this gadget when window is opened. Defaults to 50.
  4491.  
  4492. minwidth=number (minw=)
  4493.  
  4494.  Set the minimum width for this gadget
  4495.  
  4496. minheight=number (minh=)
  4497.  
  4498.  Set the minimum height for this gadget
  4499.  
  4500. weightedwidth=number (weiw=)
  4501.  
  4502.  Set the weighted width for this gadget
  4503.  
  4504. weightedheight=number (weih=)
  4505.  
  4506.  Set the weighted height for this gadget
  4507.  
  4508. nominalsize (noms)
  4509.  
  4510.  Set this gadget to its nominal size.
  4511.  
  4512. tags="tags|data[|tag|data...]|0
  4513.  
  4514.  A list of tag and value pairs in HEX. Do not forget the trailing null !
  4515.  
  4516. childlabel    (chl)
  4517. childlabelr   (chlr)
  4518.  
  4519.  Use the previously defined image as a childlabel for this gadget. Display 
  4520. the childlabel to the right or left of the gadget.
  4521.  
  4522. replace=GID
  4523.  
  4524.  Use this gadget to replace an existing gadget specified by GID.
  4525.  
  4526. Definition Reply
  4527. -----------------
  4528.  
  4529.  When the gadget creation is successful the pipe replies with
  4530.  
  4531. 'ok GID'
  4532.  
  4533. FuelGauge gadget modify parameters.
  4534. ----------------------------------
  4535.  
  4536. disable=number (dis=)
  4537.  
  4538.  The gadget is enabled if number = 0 , disabled if number != 0.
  4539.  
  4540. gadgettext="text" (gt=)
  4541.  
  4542.  Set the text of the gadget.
  4543.  
  4544. defnumber=number  (defn=)
  4545.  
  4546.  Value for this gadget .
  4547.  
  4548. get=TAG
  4549.  
  4550.  Read the value of a specific gadget attribute. Returns a blank line if 
  4551. attribute is not readable. This should not be combined with any other modify 
  4552. command on the same line.
  4553.  
  4554. refresh (ref)
  4555.  
  4556.  Redraw the gadget.
  4557.  
  4558. ------------------------------------------------------------------------------
  4559.                                4.2.6.2 Scroller                               
  4560. ------------------------------------------------------------------------------
  4561.  
  4562. Scroller gadget event.
  4563. -------------------------
  4564.  
  4565. 'gadget GID scroller_value'
  4566.  
  4567. Scroller gadget parameters.
  4568. -------------------------
  4569.  
  4570. font=GID
  4571.  
  4572. This sets the font for the gadget. The GID points to an ALREADY defined text 
  4573. attribute.
  4574.  
  4575. readonly (ro)
  4576.  
  4577.  This gadget is read only.
  4578.  
  4579. disable=number (dis=)
  4580.  
  4581.  The gadget is enabled if number = 0 , disabled if number != 0. Defaults to 
  4582. enabled.
  4583.  
  4584. vertical   (v)
  4585.  
  4586.  This gadget is free vertically, defaults to free horizontally.
  4587.  
  4588. arrows (a)
  4589.  
  4590.  Switch to display arrows for this gadget.
  4591.  
  4592. delta=number
  4593.  
  4594.  The change in the gadget when an arrow is clicked. Defaults to 1.
  4595.  
  4596. knob=number
  4597.  
  4598.  The size of the knob in the slider.
  4599.  
  4600. maxnumber=number (maxn=)
  4601.  
  4602.  Maximum value for this gadget. Defaults to 100.
  4603.  
  4604. defnumber=number  (defn=)
  4605.  
  4606.  Value for this gadget when window is opened. Defaults to 0.
  4607.  
  4608. minwidth=number (minw=)
  4609.  
  4610.  Set the minimum width for this gadget
  4611.  
  4612. minheight=number (minh=)
  4613.  
  4614.  Set the minimum height for this gadget
  4615.  
  4616. weightedwidth=number (weiw=)
  4617.  
  4618.  Set the weighted width for this gadget
  4619.  
  4620. weightedheight=number (weih=)
  4621.  
  4622.  Set the weighted height for this gadget
  4623.  
  4624. nominalsize (noms)
  4625.  
  4626.  Set this gadget to its nominal size.
  4627.  
  4628. replace=GID
  4629.  
  4630.  Use this gadget to replace an existing gadget specified by GID.
  4631.  
  4632. Definition Reply
  4633. -----------------
  4634.  
  4635.  When the gadget creation is successful the pipe replies with
  4636.  
  4637. 'ok GID'
  4638.  
  4639. Scroller gadget modify parameters.
  4640. -------------------------
  4641.  
  4642. disable=number (dis=)
  4643.  
  4644.  The gadget is enabled if number = 0 , disabled if number != 0.
  4645.  
  4646. defnumber=number  (defn=)
  4647.  
  4648.  Value for this gadget.
  4649.  
  4650.  
  4651. ------------------------------------------------------------------------------
  4652.                                 4.2.6.3 Slider                                
  4653. ------------------------------------------------------------------------------
  4654.  
  4655. Slider gadget event.
  4656. -------------------------
  4657.  
  4658. 'gadget GID slider_value'
  4659.  
  4660. slider gadget parameters.
  4661. -------------------------
  4662.  
  4663. readonly (ro)
  4664.  
  4665.  This gadget is read only.
  4666.  
  4667. disable=number (dis=)
  4668.  
  4669.  The gadget is enabled if number = 0 , disabled if number != 0. Defaults to 
  4670. enabled.
  4671.  
  4672. ticks=number
  4673.  
  4674.  Set how many ticks to display along the slider.
  4675.  
  4676. Sticks
  4677.  
  4678.  Show every second tick as a short tick.
  4679.  
  4680. Flip
  4681.  
  4682.  Reverse the min and max positions on the slider.
  4683.  
  4684. vertical   (v)
  4685.  
  4686.  This gadget is free vertically, defaults to free horizontally.
  4687.  
  4688. maxnumber=number (maxn=)
  4689.  
  4690.  Maximum value for this gadget. Defaults to 100.
  4691.  
  4692. minnumber=number (minn=)
  4693.  
  4694.  Maximum value for this gadget. Defaults to 100.
  4695.  
  4696. selected=number  (s=)
  4697.  
  4698.  Value for this gadget when window is opened. Defaults to 0.
  4699.  
  4700. useimage (ui)
  4701.  
  4702.  Use the last defined image as the knob for this slider.
  4703.  
  4704. bodyimage (bi)
  4705.  
  4706.  Use the last defined image as the body of this slider.
  4707.  
  4708.  NOTE: if both useimage and bodyimage are given, the knob gets the last 
  4709. defined image , the body gets the send last defined image.
  4710.  
  4711. minwidth=number (minw=)
  4712.  
  4713.  Set the minimum width for this gadget
  4714.  
  4715. minheight=number (minh=)
  4716.  
  4717.  Set the minimum height for this gadget
  4718.  
  4719. weightedwidth=number (weiw=)
  4720.  
  4721.  Set the weighted width for this gadget
  4722.  
  4723. weightedheight=number (weih=)
  4724.  
  4725.  Set the weighted height for this gadget
  4726.  
  4727. nominalsize (noms)
  4728.  
  4729.  Set this gadget to its nominal size.
  4730.  
  4731. replace=GID
  4732.  
  4733.  Use this gadget to replace an existing gadget specified by GID.
  4734.  
  4735. Definition Reply
  4736. -----------------
  4737.  
  4738.  When the gadget creation is successful the pipe replies with
  4739.  
  4740. 'ok GID'
  4741.  
  4742. slider gadget modify parameters.
  4743. -------------------------
  4744.  
  4745. disable=number (dis=)
  4746.  
  4747.  The gadget is enabled if number = 0 , disabled if number != 0.
  4748.  
  4749. selected=number  (s=)
  4750.  
  4751.  Value for this gadget.
  4752.  
  4753.  
  4754. ------------------------------------------------------------------------------
  4755.                               4.2.6.4 WeightBar                               
  4756. ------------------------------------------------------------------------------
  4757.  
  4758. WeightBar parameters
  4759. ----------------------
  4760.  
  4761. WeightBar
  4762.  
  4763. Place a user controllable weightbar in the GUI. WeightBar has no parameters.
  4764.  
  4765. Definition Reply
  4766. -----------------
  4767.  
  4768.  When the gadget creation is successful the pipe replies with
  4769.  
  4770. 'ok'
  4771.  
  4772. ------------------------------------------------------------------------------
  4773.                               4.2.6.5 Commodity                               
  4774. ------------------------------------------------------------------------------
  4775.  
  4776. Commodity event
  4777. ----------------
  4778.  
  4779. Commodity    "cx TYPE [SUBTYPE]"
  4780.  
  4781.  TYPE=hotkey            The commodities hotkey has been detected.
  4782.  TYPE=kill              The commodity has been requested to quit.
  4783.  TYPE=unique            Another commodity with the same name tried to start 
  4784. (but always fails)
  4785.  TYPE=show              The commodity has been requested to show its GUI.
  4786.  TYPE=hide              The commodity has been requested to hide its GUI.
  4787.  TYPE=disable           The commodity has been disabled.
  4788.  TYPE=enable            The commodity has been enabled.
  4789.  
  4790.  
  4791.  With dis/enable your commodity is automatically enabled or disabled. You 
  4792. MUST respect this in your program. With other commodity events you SHOULD TRY 
  4793. to react in some proper way.
  4794.  
  4795.  The next three types are included to alow for future enhancements of the 
  4796. Amiga Commodity ability.
  4797.  
  4798.  TYPE=command SUBTYPE   The commodity has received an unrecognized command. 
  4799. The subtype is the messageID.
  4800.  TYPE=event SUBTYPE     The commodity has received an unrecognized event. The 
  4801. subtype is the messageID.
  4802.  TYPE= NUMBER SUBTYPE   The commodity has received an unrecognized message 
  4803. type. Number is the message type, subtype is the messageID.
  4804.  
  4805. Commodity parameters
  4806. --------------------
  4807.  
  4808. You may only create one commodity object, per GUI.
  4809.  
  4810. CxName="name"
  4811.  
  4812. Name Commodities uses to identify this commodity.(REQUIRED)
  4813.  
  4814. CxPri=number
  4815.  
  4816. The priority of your commodity, defaults to 0.
  4817.  
  4818. CxTitle="title"
  4819.  
  4820. Title of commodity that appears in CXExchange.
  4821.  
  4822. CxDesc="description"
  4823.  
  4824. Description of the commodity.
  4825.  
  4826. CxHotkey=" hotkey description"
  4827.  
  4828. example  CxHotKey="ctrl alt f1"
  4829.  
  4830. CxNoGui
  4831.  
  4832. Do not allow CXExchange to request GUI open and closing.
  4833.  
  4834. Definition Reply
  4835. -----------------
  4836.  
  4837.  When the commodity creation is successful the pipe replies with
  4838.  
  4839. 'ok'
  4840.  
  4841. Modify parameters
  4842. -----------------
  4843.  
  4844. Normally you should not need to disable or enable your commodity as it is 
  4845. handled automatically. This gives you the ability to override the automatic 
  4846. control, use it carefully.
  4847.  
  4848. Commodity=number
  4849.  
  4850. If number =0 then disable the commodity, else enable the commodity. Replied 
  4851. to with ok.
  4852.  
  4853. ------------------------------------------------------------------------------
  4854.                                   4.3 Events                                  
  4855. ------------------------------------------------------------------------------
  4856.  
  4857. EVENT TYPES
  4858. -------------
  4859. Gadget hit     "gadget GID [gadget specific data]"
  4860.  Read gadget information for specifics.
  4861.  
  4862. Help           "help GID MOUSEX MOUSEY<cr>"
  4863.  The mouse is over the gadget specified. The mouse location is useful in 
  4864. determining where to open a help window.
  4865.  
  4866. Keystroke      "key KEYCODE QUALIFIER<cr>"
  4867.  The user hit a key. Raw keycodes are returned along with the current 
  4868. qualifier.
  4869.  
  4870. Qualifier      "qual QUALIFIER<cr>"
  4871.  
  4872.  A change in the current qualifier is detected. Not all qualifier changes 
  4873. will cause events. HOWEVER the last qualifier event will ALWAYS be correct 
  4874. for the event(s) that follow it.
  4875.  
  4876. Close          "close CLOSESOURCE<cr>"
  4877.  The window has been closed.
  4878.  CLOSESOURCE=0        WindowClose Gadget
  4879.  CLOSESOURCE=-1       Closed by CTRL-BackSlash
  4880. else CLOSESOURCE=GID  Closed by GID
  4881.  
  4882. Commodity    "cx TYPE [SUBTYPE]"
  4883.  
  4884.  The Commodity object received a message.
  4885.  
  4886. AskClose   "askclose"
  4887.  
  4888.  User tried to close the GUI window. (not always used see window docs)
  4889.  
  4890. Refresh        "refresh"
  4891.  
  4892.  The window has been sized or altered and you should refresh any components 
  4893. you manually draw into the window. (You only ask for and watch these events 
  4894. if you use the 'Draw' modify command.)
  4895.  
  4896. Menu           "menu  MENU# ITEM# SUBITEM# CHECKED<cr>"
  4897.  
  4898.  Menu selected.
  4899. checked=0 Item is not checked
  4900. checked=1 Item is checked
  4901.  
  4902.  Be careful of false (undefined) menu hits.
  4903.  
  4904. Window Active  "active 0|1<cr>"
  4905.  0= window inactive
  4906.  1= window active
  4907.  
  4908. Application  "app FILENAME <cr>"
  4909.  
  4910.  An icon has been dropped on the window.
  4911.  
  4912. Iconify  "iconify MODE<cr>"
  4913.  
  4914. mode 0 = uniconify
  4915. mode 1 = iconify
  4916.  
  4917. Iconify events are only sent if modify is turned on. You must manually 
  4918. iconify or uniconify the window in this case. See window.doc.
  4919.  
  4920. If modify is not turned on the iconification is automatic and no iconify 
  4921. events are sent.
  4922.  
  4923. ARexx command  "arexx FID len <cr> command"
  4924.  
  4925.  You must first read the arexx event, the read len additional characters.
  4926.  
  4927. See the  docs for each gadget type for more information.
  4928.  
  4929.  
  4930. ------------------------------------------------------------------------------
  4931.                                   4.4 Modify                                  
  4932. ------------------------------------------------------------------------------
  4933.  
  4934. Modifying the GUI Window and its gadgets
  4935. =========================================
  4936.  
  4937. All modify commands are replied to with either 'ok' or error. If more than 
  4938. one gadget parameter is changed by the modify command the reply can be 'ok ok 
  4939. ...' .  A reply of a blank line means the modify command was not understood 
  4940. and was ignored.
  4941.  
  4942. See the documentation for each gadget type for information on modifying that 
  4943. type of gadget type.
  4944.  
  4945. Modify commands that change gadget parameters begin with 'id GID' Gadgets are 
  4946. modified with the following  line format
  4947.  
  4948. 'id GID parameter1[=value] parameter2[=value] parameter3[=value] ...
  4949.  
  4950. example 'id 2 gadgettext="new text" disable=1'
  4951.  
  4952. The parameters allowed depend on the type of gadget that GID refers to.
  4953.  
  4954. NOTE: When modifying gadgets on a clicktab page, you should add the page 
  4955. parameter to the modify line.
  4956.  
  4957. Modify Parameters for all gadgets
  4958. (except menu, arexxhost, textattr)
  4959. ------------------------------
  4960. address
  4961.  
  4962. Read the address of object associated with the GID and information about the 
  4963. gadget type. This modify command MUST be ' id GID address' and returns 
  4964. 'ADDRESS GADGETTYPE'
  4965.  
  4966. An address of 0 means no object is associated with the GID.
  4967.  
  4968. page="GID"
  4969.  
  4970.  Specify the clicktab gadget that controls the page containing the gadget to 
  4971. be modified. Most gadgets seem to modify fine without this being set, but it 
  4972. must be used for string gadgets. It should probably be used for all gadgets 
  4973. on clicktab pages to ensure future compatability.
  4974. NOTE: you supply the Gadget ID of the clicktab, NOT the number of the page 
  4975. inside the clicktab.
  4976.  
  4977. set
  4978.  
  4979.  'Set' sets gadget parameters from the supplied tag list. Both 'set' and 
  4980. 'tags' must be used to do this.
  4981.  
  4982. tags="tags|data[|tag|data...]|0
  4983.  
  4984. A list of tag and value pairs in HEX. Do not forget the trailing null !
  4985.  
  4986. Get="hexvalue"
  4987.  
  4988. This special modify command lets you read a value associated with a gadget 
  4989. The pipe replies with 'ok value' when successful, a blank line if it fails.
  4990.  
  4991. example 'id 3 get xxxxxxxx'
  4992.  
  4993. This reads the selected color in a palette gadget (whose GID is 3).
  4994.  
  4995.  
  4996. Read Gadget modify instruction
  4997. ------------------------------
  4998.  
  4999. 'id GID read'
  5000.  
  5001.  
  5002.  Read must not be used with other parameters besides GID.
  5003. 'id GID read'
  5004.  Read the gadget specified by GID. The pipe returns the same information as 
  5005. when a user hits a gadget but without the leading 'gadget gid'. In the case 
  5006. of GID=0 read returns the windows 'left top width height' settings.
  5007.  
  5008. Gadget interconnection modify
  5009. -----------------------------
  5010. This function may only be useful to programmers already familiar with 
  5011. interconnection who have registered CA documentation.
  5012.  
  5013. Target="gadget_ID"  (tar=)
  5014.  
  5015. The gadget to be interconnected with.
  5016.  
  5017. tags="tagsource|tagdest[|tagsource|tagdest..]|0
  5018.  
  5019. The list of tags for interconnection in HEX. Tags must be in pairs, and do 
  5020. not forget the trailing null!
  5021.  
  5022. example. 'id 3 target 2  tags="5001005|5001005|0" '
  5023.  
  5024. Selections made on chooser gadget 3 are connected to chooser
  5025. gadget 2.
  5026.  
  5027.  
  5028. Modify Control instructions
  5029. ----------------------------
  5030.  
  5031. Some modify commands do not actually modify any gadgets.
  5032.  
  5033. mouse
  5034.  
  5035.  Get the position of the pointer. This returns the both the position relative 
  5036. to the window and relative to the screen.
  5037.  
  5038. 'windowX windowY screenX screenY'
  5039.  
  5040. Help="num"
  5041.  
  5042. If num =0 turn help events off, if num!=0 then turn help events on.
  5043.  
  5044. pointer
  5045.  
  5046.  Set the pointer for the window, if pointerdata is not specified set the 
  5047. pointer to default pointer. I pointer data is given see below.
  5048.  
  5049. pointerdata="height|width|hotx|hoty|data1|data2|..."  (pd=)
  5050.  
  5051.  Pointer data is the definition for a pointer. For more information see the 
  5052. intuition call SetPointer(). Pointerdata="" is a special case setting the 
  5053. pointer to a null (invisible) pointer.
  5054.  
  5055. specialchar="character" (sc=)
  5056.  
  5057.  'Character' is a single character that replaces '|', in use as a separator 
  5058. inside parameters like chooserlabels, tags, penmapdata, ...
  5059.  
  5060.  You should usually use this alone on a modify line, used inside modify 
  5061. commands like add node it will cause an extra 'ok' in the response line.
  5062.  
  5063. Quiet  (q)
  5064.  
  5065.  Tell the pipe not to reply to the modify commands. This is actually a toggle 
  5066. switch turning replies off and on. SOME modify commands are ALWAYS replied 
  5067. to. (addnode and getfile selected 0|1)
  5068.  
  5069. refresh (ref)
  5070.  
  5071.  Refresh the gadget referenced by GID. The refresh command can be combined 
  5072. with any other modify command and is always executed last. GID=0 will refresh 
  5073. the windows root layout, this is the best way to refresh all gadgets.
  5074.  
  5075.  Refresh without a GID specified will refresh the entire window, usually it 
  5076. is better to refresh the root class as described above.
  5077.  
  5078. close
  5079.  
  5080.  Close the CA window. Dispose of window and end the pipe connection to the 
  5081. GUI host.
  5082.  
  5083. tick=number
  5084.  
  5085.  End the modify conversation, Reply with a tick event after number/100 
  5086. seconds.
  5087.  
  5088. Continue (con)
  5089.  
  5090.  End the modify conversation.
  5091.  
  5092. Modifyoff (m)
  5093.  
  5094.  End the modify conversation AND turn modify off. (do not start any new 
  5095. modify conversations). Note there will be no way to turn modify back on.
  5096.  
  5097. Beep=num
  5098.  
  5099.  Beep the display. If num =0 beep all screens , else beep the GUI's screen.
  5100.  
  5101.  
  5102. Bubble Help
  5103. ------------
  5104.  
  5105. Each GUI can show one bubble help window at a time.
  5106.  
  5107. bubble top=numx left=numy gt="Help Text"
  5108.  
  5109. This opens a bubble showing the help text. Top and left are mouse location 
  5110. for the help (as sent to you in the help event you are responding to). Any 
  5111. previous help window will be closed.
  5112.  
  5113. 'bubble' sent with no parameters will close the bubble with out opening a new 
  5114. one.
  5115.  
  5116. Image Functions
  5117. ----------------
  5118.  
  5119. FreeImage="num"  fi=
  5120.  
  5121. if num=-1 Dispose of a previously defined image without using it. Else free 
  5122. the root bitmap image in buffer num. Be careful not to do this while images 
  5123. still exist that reference this root bitmap.
  5124.  
  5125. Draw="num" top="num" left="num"
  5126.  
  5127. Draw an image into the gui. Num is the number of the predefined image to be 
  5128. drawn. You MUST set 'top' and 'left' and can also set
  5129.  
  5130.  nozz
  5131.  
  5132. Top and left are relative th the whole window rather than the inner panel.
  5133.  
  5134.  noclip
  5135.  
  5136. Allow images to overwrite the windows boarder.
  5137.  
  5138. The image number relates to images you have created but not used in your GUI.
  5139. For example...
  5140.  
  5141. You create an image 'bitmap fn="cat.gif"'  it is image 0.
  5142. You create another image 'bitmap fn="dog.gif"' it is image 1.
  5143. You create another image 'bitmap fn="bird.gif"' it is image 2.
  5144.  
  5145. You create a BUTTON using the last image created 'button useimage', the
  5146. button used the bird image so it is no longer in the image list.
  5147.  
  5148. You create another image 'bitmap fn="frog.gif"' it is image 2.
  5149.  
  5150. You now have 3 images available to draw
  5151.  
  5152. 0 cat
  5153. 1 dog
  5154. 2 frog
  5155.  
  5156. Drawing images DOES NOT remove images from the image list. Incorporating 
  5157. images directly in your GUI DOES remove images from the image list. The image 
  5158. number is NOT related to the buffer number in the bitmap image parameters.
  5159.  
  5160.  
  5161.  
  5162. GID 0
  5163. -------
  5164.  
  5165. GID 0 is used to specify the GUI window itself. It can be used to control 
  5166. certain aspects of the window. (see window docs)
  5167.  
  5168. Defining new gadgets during modify
  5169. ------------------------------------
  5170.  
  5171. define
  5172.  
  5173.  This causes the current line to be used as a Gadget definition statement 
  5174. rather than modify. You can add or replace gadgets in the already opened 
  5175. window. You may need to send a refresh modify command to make the changes 
  5176. visible.
  5177.  
  5178. replace="GID"
  5179.  
  5180.  The newly defined gadget replaces the existing gadget specified by GID. The 
  5181. pipe tries to free the resources used by the previous gadget right away, but 
  5182. some memory is not freed until the pipe is closed.
  5183.  
  5184.  WHEN USING REPLACE DO NOT ASSUME WHAT THE RESULTING GID OF THE NEW GADGET 
  5185. WILL BE. The usual sequence of allocated gadget ID's is not followed. 
  5186. Replacing a layout group frees all gadgets in the group as well as the layout 
  5187. itself. Replacing a listbrowser frees its nodes.
  5188.  
  5189.  You MUST keep track and not try to access gadgets that no longer exist.
  5190.  
  5191. Generally it is better to close the window and open a new one rather than 
  5192. using replace or define. On the other hand some pretty neat thing can be done 
  5193. using them. ;-D
  5194.  
  5195. NOTE: There is a problem when replacing a gadget with a Listbrowser gadget 
  5196. (or a layout containing one). I advise NOT to do this. Open a new window 
  5197. instead.
  5198.  
  5199.  
  5200. ------------------------------------------------------------------------------
  5201.                                4.5 GUI Tutorial                               
  5202. ------------------------------------------------------------------------------
  5203.  
  5204.  
  5205. ------------------------------------------------------------------------------
  5206.                                  4.5.1 Design                                 
  5207. ------------------------------------------------------------------------------
  5208.  
  5209.  Working through these tutorials in order is the best way to learn to build 
  5210. GUI's with AWNPipe. A few minutes here will save you hours of development 
  5211. time later.
  5212.  
  5213.  TUTORIAL 1
  5214. -----------
  5215.  
  5216. Building GUIs can be VERY easy, This first tutorial will develop a simple 
  5217. GUI.
  5218.  
  5219. Create a simple 4 line text file called first.gui. (You can use drag 
  5220. selection and Right-Amiga-C to copy text from these docs.)
  5221.  
  5222.  title "My first GUI" defaultgadgets
  5223.  button gadgettext "YES"
  5224.  button gt "NO"
  5225.  open
  5226.  
  5227. Now, in a shell, type 'copy first.gui awnpipe:/xc'.
  5228.  
  5229. That was easy. You already guessed that gt was a short form for gadgettext.
  5230.  
  5231. Now we want to see what events the GUI sends. We can direct the events to a 
  5232. con by adding 'wcon:' to the end of the pipe name. Try
  5233.  
  5234. 'copy first.gui awnpipe:/xcwcon:'
  5235.  
  5236. Look at the output in the con:. Notice that the pipe replies to each line of 
  5237. the definition file, as well as sending events.
  5238.  
  5239. Now add a little text to the gui. We will also provide keyboard shortcuts for 
  5240. the gadgets.
  5241.  
  5242.  title "My first GUI" defaultgadgets
  5243.  label  gt " Select YES or NO "
  5244.  button gadgettext "_YES"
  5245.  button gadgettext "_NO"
  5246.  open
  5247.  
  5248. That worked, but it looks a little UGLY. Let's try a vertical layout instead 
  5249. of the default horizontal layout.
  5250.  
  5251.  title "My first GUI" defaultgadgets  vertical
  5252.  label  gt " Select YES or NO "
  5253.  button gadgettext "_YES"
  5254.  button gadgettext "_NO"
  5255.  open
  5256.  
  5257. The GUI is starting to look better, but we really want the two gadgets 
  5258. side-by-side. To do that, we will use a layout group. ("le" is short for 
  5259. "layout end".)
  5260.  
  5261.  title "My first GUI" defaultgadgets  vertical
  5262.  label  gt " Select YES or NO "
  5263.  layout
  5264.  button gadgettext "_YES"
  5265.  button gadgettext "_NO"
  5266.  le
  5267.  open
  5268.  
  5269. That is much better! The GUI looks good, but it would be nicer if the window 
  5270. closed after the user selected yes or no. (You should also notice that the 
  5271. layout received a GID number, so yes and no are now gadget 2 and 3.)
  5272.  
  5273.  title "My first GUI" defaultgadgets  vertical
  5274.  label  gt " Select YES or NO "
  5275.  layout
  5276.  button gadgettext "_YES" close
  5277.  button gadgettext "_NO" c
  5278.  le
  5279.  open
  5280.  
  5281. It's done and it might even be useful.
  5282.  
  5283. Since we have a working GUI, let's use it to see a few other types of events 
  5284. the GUI can generate.
  5285.  
  5286.  title "My first GUI" defaultgadgets  vertical  sendkeys sendqual help state
  5287.  label  gt " Select YES or NO "
  5288.  layout
  5289.  button gadgettext "_YES" close
  5290.  button gadgettext "_NO" c
  5291.  le
  5292.  open
  5293.  
  5294. Activate and deactivate the window. Hold the mouse over each gadget. Type a 
  5295. few keys. Try the shift, alt etc.
  5296.  
  5297.  
  5298.  
  5299. ------------------------------------------------------------------------------
  5300.                                4.5.2 Operation                                
  5301. ------------------------------------------------------------------------------
  5302.  
  5303. This tutorial has two versions, Arexx and 'C'. The 'C' tutorial is after the 
  5304. Arexx one.
  5305.  
  5306. Before reading further, take a moment to run the tutorial so you understand 
  5307. what the program does.
  5308.  
  5309. TUTORIAL 2 ARexx
  5310. ----------------
  5311.  
  5312.  Now that we know how to designed a GUI we want to be able to operate one. To 
  5313. follow this example you need a basic knowledge of ARexx. Have a look at the 
  5314. file Tutorial2.rx in the demos drawer.
  5315.  
  5316.  The program flow is straight forward. 3 simple steps.
  5317.  
  5318. 1. Default values are set. These are the values of the gadgets when the GUI 
  5319. opens.
  5320.  
  5321. 2. A routine (buildgui) is called to write the GUI definition to the pipe. 
  5322. (More on this routine later)
  5323.  
  5324. 3. Events are read from the pipe and processed until the stream of events 
  5325. ends.
  5326.  
  5327. BUILDGUI
  5328.  
  5329.  The 'buildgui' routine contains the information defining the GUI window and 
  5330. its gadgets. The data is sent line by line to the 'topipe' routine which 
  5331. sends the data to the pipe, checks for errors, and returns the GID returned 
  5332. by the pipe. (more on 'topipe' later.)
  5333.  
  5334.  For most lines sent with 'topipe' the response is ignored. For gadget 
  5335. definitions however the return value is stored so we can identify gadget 
  5336. events later on.
  5337.  
  5338. TOPIPE
  5339.  
  5340.  This routine takes a line of text and writes it to the pipe. The pipes 
  5341. response is read. If everything is ok the second parameter of the response is 
  5342. returned. This is the GID if a gadget is defined and a null string in most 
  5343. other cases. If an error occurs the problem line is output and the script 
  5344. exits.
  5345.  
  5346.  You should use this routine or one like it when writing your own script for 
  5347. AWNPipe. It will help avoid common errors and make debugging much easier.
  5348.  
  5349. EVENT HANDLING
  5350.  
  5351.  The main loop reads an event from the pipe and parses it into its parts. The 
  5352. first word of an event always tells the event type. This information is used 
  5353. to call a routine for that type of event.
  5354.  
  5355. CLOSE EVENT
  5356.  
  5357. If a close event is received write a little text and then exit the script.
  5358.  
  5359. GADGET EVENT
  5360.  
  5361.  We check the second word of the event to see which gadget sent the event. 
  5362. For most gadgets we store event information and return. If the cancel gadget 
  5363. is the cause of the event we output some text and exit. If it was the done 
  5364. gadget we output the information for each gadget and exit. If it was the 
  5365. reset gadget we close the pipe, then create the gui again to restore the 
  5366. default values.
  5367.  
  5368. MENU EVENT
  5369.  
  5370.  The second word of a menu event is the menu number, the third word id the 
  5371. item number, and the forth the subitem number. This information is used to 
  5372. determine what action should be taken in response to an event.
  5373.  
  5374.  Almost any GUI can be operated using this approach demonstrated in this 
  5375. tutorial. Use these functions as building blocks in your own scripts.
  5376.  
  5377. TUTORIAL 2 in C
  5378. ----------------
  5379.  
  5380. The files tutorial2.c and tutorial2 can be found in in the demos drawer.
  5381.  
  5382.  Now that we know how to designed a GUI we want to be able to operate one. To 
  5383. follow this example you need a basic knowledge of 'C'. Have a look at the 
  5384. file Tutorial2.c in the demos drawer. We will examine each of the functions 
  5385. in detail since they will be useful building blocks for making other GUIs. 
  5386. There is only 1 interesting structure.
  5387.  
  5388. struct GUIpipe myGP
  5389.  
  5390. This structure is used to manage the GUI. It contains the GUIs file handle, 
  5391. error status,and read buffer. It as has storage for some useful data parsed 
  5392. from replies or events.
  5393.  
  5394.  int main( int argc, char *argv[]);
  5395.  
  5396.  The program flow is straight forward. Default values are set. We call a 
  5397. routine to build the GUI and operate the gui if we built it successfully. To 
  5398. operate the GUI we simply read events and react to them. Before we exit we 
  5399. make sure the GUIs filehandle is closed.
  5400.  
  5401.  int getline(struct GUIpipe * GP);
  5402.  
  5403.  We need to handle text one line at a time when operating the GUI. This 
  5404. routine reads the pipe making a sure a full line is available before 
  5405. returning. It will remove the previous line from the buffer first if there 
  5406. was one. We delimit the line with a null byte so we can use it as a string in 
  5407. other functions.
  5408.  
  5409.  __stdargs int topipe(struct GUIpipe * GP, UBYTE * data,...)
  5410.  
  5411.  Again and Again you will need to write a line to the pipe and read the 
  5412. response. This routine does that for you. It writes data to the pipe and then 
  5413. reads a reply from the pipe. The reply line is parsed, and an error is 
  5414. flagged if the first part of the reply is not 'ok'. We return the value of 
  5415. the second reply part if all is ok, return 0 if an error occurred.
  5416.  
  5417.  topipe allows Printf like formatting of data written to the pipe (VFPrintf 
  5418. is used). The regular Printf formats are supported. This is not needed in 
  5419. this example but it will be very useful as we expand the program in the other 
  5420. tutorials.
  5421.  
  5422.  int buildgui(struct GUIpipe * GP);
  5423.  
  5424.  All the information that defines the GUI is contained in this function. It 
  5425. opens a filehandle on the AWNPipe device and returns an error if this fails. 
  5426. The window and gadget definitions are written to the pipe and the returned 
  5427. gadget ID's are stored. If all gadgets are created ok the window is opened. 
  5428. The final error status of the GUI is returned.
  5429.  
  5430. int getevent(struct GUIpipe * GP);
  5431.  
  5432.  This routine reads a line from the pipe and parses it storing information 
  5433. about the event. It returns the error status of the pipe.
  5434.  
  5435.  int gadgets(struct GUIpipe * GP);
  5436.  int menu(struct GUIpipe * GP);
  5437.  
  5438.  These routines look at the information parsed from the last event and take 
  5439. appropriate action depending which gadget or menu item was selected. Some 
  5440. times the gadget state information from the event is stored. Other times 
  5441. information is output to the user.
  5442.  
  5443.  int gperror(struct GUIpipe * GP,int error);
  5444.  
  5445.  When an error is detected while reading or writing to the pipe this routine 
  5446. is called. It sets the error status and alerts the user an error has 
  5447. occurred.
  5448.  
  5449.  UBYTE * eventstr(struct GUIpipe * GP, int num);
  5450.  
  5451. Some fields in events , like string gadget contents, can contain spaces. This 
  5452. functions returns a pointer to the 'num' word of the event. Since the line is 
  5453. delimited by a null you can treat this as a string pointer. If the 'num' word 
  5454. is not found NULL is returned. The pointer is only valid until the next call 
  5455. to getline(), getevent(), or topipe().
  5456.  
  5457.  Almost any GUI can be operated using this approach demonstrated in this 
  5458. tutorial.
  5459.  
  5460. ------------------------------------------------------------------------------
  5461.                               4.5.3 Modification                              
  5462. ------------------------------------------------------------------------------
  5463.  
  5464.  Before reading this section take a moment and run tutorial 3, knowing what 
  5465. the GUI does will help in understanding the code behind it.
  5466.  
  5467. This tutorial has two versions, Arexx and 'C'. The 'C' tutorial is after the 
  5468. Arexx one.
  5469.  
  5470. TUTORIAL 3 AREXX
  5471. ---------------
  5472.  
  5473.  This tutorial deals with modifying a GUI after it has been opened. You 
  5474. should make sure you understand tutorial 2 before reading further.
  5475.  
  5476.  Three new gadgets have added to the gui. The load and save gadgets on the 
  5477. lower left, and a get file gadget that you do not see. The getfile gadget is 
  5478. unattached (ua) so it is not displayed in the gui. More on the getfile gadget 
  5479. later.
  5480.  
  5481.  The window definition line (in buildGUI:) has the modify option added to it. 
  5482. This means the pipe will look for modify commands after you fist open the 
  5483. window, and after each event is sent. Any number of modify commands can be 
  5484. written to the pipe, including 0 (none). After writing the modify commands 
  5485. 'continue' must be sent to the pipe to tell it to start sending events. After 
  5486. you get an event the pipe starts waiting for modify commands again.
  5487.  
  5488.  Only two changes are made in the program flow.
  5489.  
  5490. 1.  After BUILDGUI is called to build and open the window we send a modify 
  5491. command to the pipe.
  5492.  
  5493. topipe('id 'savegad' dis 1 ref')
  5494.  
  5495.  The id specifies the save gadget, 'dis 1' disables it, and 'ref' refreshes 
  5496. it so the changes will show. (we want the save gadget disabled because the 
  5497. name gadget is empty at start up, and we need a name before we can save).
  5498.  
  5499. 2. In the mail loop a 'continue' is written to the pipe BEFORE we wait for an 
  5500. event. This tells to pipe to stop looking for modify commands and send an 
  5501. event.
  5502.  
  5503.  After an event is read from the pipe it automatically starts looking for 
  5504. more modify events. This means that modify commands can be used immediately 
  5505. after receiving an event from the pipe.
  5506.  
  5507.  RESETFORM
  5508.  
  5509.  In tutorial 2 we had to close then open the GUI to reset its contents. With 
  5510. modify commands we can do this with the gui remaining open. The function 
  5511. resetform is near the end of tutorial3.rx.
  5512.  
  5513.  This function sends a modify command for each of the gadgets resetting them 
  5514. to the default values. It also disables the save gadget.
  5515.  
  5516.  SAVEFORM
  5517.  
  5518.  This function is called when the user hits the save gadget. It writes the 
  5519. forms contents to a file in 't:'. The files name is the text from the name 
  5520. gadget with '.formdemo' appended to it. The save gadget is disabled unless 
  5521. the name gadget contains text. See the handling of namegad in the GADGET: 
  5522. routine.
  5523.  
  5524.  LOADFORM
  5525.  
  5526.  This function makes use of the unattached GETFILE gadget. A modify command 
  5527. is used to set the file name in the file requester, and to open the requester 
  5528. itself. The pattern used in the file requester was set when the gadget was 
  5529. created in the BUILDGUI routine.
  5530.  
  5531. call writeln(ca,'id 'getfilegad' fn "t:" s 1')
  5532.  
  5533. 'fn "t:"' sets the file requester to the drawer T:. 's 1' opens the 
  5534. requester.
  5535.  
  5536.  The return from the pipe to this modify command is read and parsed to get 
  5537. the file selected and to test if the user selected a file or aborted the 
  5538. requester. The reply from the pipe is ...
  5539.  
  5540. SUCCESS ["filename"]
  5541.  
  5542.  Success is 0 if the user aborts the file requester, non zero if a file is 
  5543. selected. The file name is always returned in quotes since multiple files can 
  5544. be selected in some situations. (but not this situation).
  5545.  
  5546.  If the user selected a file, it is opened and the contents placed in the 
  5547. GUI. No error checking is done on the file in order to keep the tutorial 
  5548. clear and easy to understand.
  5549.  
  5550. TUTORIAL 3 in C
  5551. ---------------
  5552.  
  5553.  This tutorial deals with modifying a GUI after it has been opened. You 
  5554. should make sure you understand tutorial 2 before reading further.
  5555.  
  5556.   int buildgui(struct GUIpipe * GP);
  5557.  
  5558. The window definition line (in buildgui()) has the modify option added to it. 
  5559. This means the pipe will look for modify commands after you fist open the 
  5560. window, and after each event is sent. Any number of modify commands can be 
  5561. written to the pipe, including 0 (none). After writing the modify commands 
  5562. 'continue' must be sent to the pipe to tell it to send an event. After you 
  5563. get an event the pipe starts waiting for modify commands again.
  5564.  
  5565.  Three new gadgets have added to the gui. The load and save gadgets on the 
  5566. lower left, and a get file gadget that you do not see. The getfile gadget is 
  5567. unattached (ua) so it is not displayed in the gui. More on the getfile gadget 
  5568. later.
  5569.  
  5570.  int main( int argc, char *argv[]);
  5571.  
  5572.  Only two changes are made in the program flow.
  5573.  
  5574. 1.  After buildgui() is called to build and open the window we send a modify 
  5575. command to the pipe.
  5576.  
  5577.      topipe(GP,"id %ld dis 1 ref\n",savegad);
  5578.  
  5579.  The id specifies the save gadget, 'dis 1' disables it, and 'ref' refreshes 
  5580. it so the changes will show. (we want the save gadget disabled because the 
  5581. name gadget is empty at start up, and we need a name before we can save).
  5582.  
  5583. 2. In the main loop a 'continue' is written to the pipe BEFORE we wait for an 
  5584. event. This tells to pipe to stop looking for modify commands and send an 
  5585. event.
  5586.  
  5587.  After an event is read from the pipe it automatically starts looking for 
  5588. more modify events. This means that modify commands can be used immediately 
  5589. after receiving an event from the pipe.
  5590.  
  5591.  int gadgets(struct GUIpipe * GP);
  5592.  
  5593.  The 'loadgad' and 'savegad' gadgets are recognised, and the handling of 
  5594. 'namegad' and 'resetgad' have changed.
  5595.  
  5596.  In tutorial 2 we had to close then open the GUI to reset its contents. With 
  5597. modify commands we can do this with the gui remaining open. We set our 
  5598. default form information and call updategui().
  5599.  
  5600.  Namegad enables or disables the savegad. If no name is set we can not 
  5601. generate a filename to save the information to.
  5602.  
  5603. int updategui(struct GUIpipe * GP);
  5604.  
  5605.  This routine updates the GUI to show the values we have stored internaly. A 
  5606. modify line is sent for each gadget. The function updateform is near the end 
  5607. of tutorial3.rx.
  5608.  
  5609.  int saveform(VOID);
  5610.  
  5611.  This function is called when the user hits the save gadget. It writes the 
  5612. forms contents to a file in 't:'. The files name is the text from the name 
  5613. gadget with '.formdemo' appended to it. The save gadget is disabled unless 
  5614. the name gadget contains text. See the handling of namegad in the gadget() 
  5615. routine.
  5616.  
  5617.  int loadform(struct GUIpipe * GP);
  5618.  
  5619.  This function makes use of the unattached GETFILE gadget. A modify command 
  5620. is used to set the file name in the file requester, and to open the requester 
  5621. itself. The pattern used in the file requester was set when the gadget was 
  5622. created in the BUILDGUI routine.
  5623.  
  5624.    FPrintf(GP->file,"id %ld fn \"t:\" s 1\n",getfilegad);
  5625.    if (getevent(GP)) return(1);
  5626.  
  5627.  
  5628. 'fn "t:"' sets the file requester to the drawer T:. 's 1' opens the 
  5629. requester.
  5630.  
  5631.  The return from the pipe to this modify command is read and parsed as an 
  5632. event since it does not return the usual 'ok'. The reply from the pipe is ...
  5633.  
  5634. SUCCESS ["filename"]
  5635.  
  5636.  Success is 0 if the user aborts the file requester, non zero if a file is 
  5637. selected. The file name is always returned in quotes since multiple files can 
  5638. be selected in some situations. (but not this situation).
  5639.  
  5640.  If the user selected a file, it is opened and the contents parsed into out 
  5641. internal form information. Then updategui() is called.. No error checking is 
  5642. done on the file in order to keep the tutorial clear and easy to follow.
  5643.  
  5644.  
  5645.  __stdargs int topipe(struct GUIpipe * GP, UBYTE * data,...);
  5646.  int getline(struct GUIpipe * GP);
  5647.  int gperror(struct GUIpipe * GP,int error);
  5648.  int getevent(struct GUIpipe * GP);
  5649.  int menu(struct GUIpipe * GP);
  5650.  UBYTE * eventstr(struct GUIpipe * GP, int num);
  5651.  VOID setdefaults(VOID);
  5652.  
  5653.  These routines have not been changed from Tutorial 2.
  5654.  
  5655.  
  5656. ------------------------------------------------------------------------------
  5657.                                  4.5.4 Extras                                 
  5658. ------------------------------------------------------------------------------
  5659.  
  5660.  If you have read the first three tutorials, but not tried building a GUI of 
  5661. your own, you should try writing a simple gui of your own before reading 
  5662. further. Tutorial 4 will be simpler to understand once you have gained a 
  5663. little experience with AWNP.
  5664.  
  5665.  Before reading this section take a moment and run tutorial 4, knowing what 
  5666. the GUI does will help in understanding the code behind it.
  5667.  
  5668.  Although Tutorial 4 is available in 'C' or Arexx the discussion is kept 
  5669. general and it applies to both.
  5670.  
  5671. TUTORIAL 4
  5672. -----------
  5673.  
  5674.  This tutorial deals with adding some of the finishing touches to AWNP GUI's. 
  5675. You should make sure you understand tutorial 3 before reading further.
  5676.  
  5677.  A few simple changes are made in the GUI. It has an iconify gadget and can 
  5678. be resized. This is done by adding 'ig' iconfygadget, 'sg' sizegadget and 
  5679. 'ii' iconimage. 'ii' specifys the file (without the .info) whose icon is used 
  5680. when iconfying the GUI, it can be omitted and default icon will be displayed. 
  5681. The 'fh' fixheight limits the sizing gadget to changing the GUI's width.
  5682.  
  5683.  Another change has been made in the GUI, it is set as an app window 
  5684. 'app'.Now when an icon is dropped on the gui (or its iconified image) an 
  5685. event is generated passing the file name of the icon that was dropped. The 
  5686. event is 'app path:filename'.
  5687.  
  5688.  We respond to the app event by uniconifying the GUI (if necessary) and 
  5689. loading the file that was dropped. Try saving some info then dropping the 
  5690. icon of the saved info on the GUI.
  5691.  
  5692.  The iconify gadget also produces a special event. 'iconify MODE' where 
  5693. MODE=1 means the user wants to iconify the GUI, and 0 means it should be 
  5694. uniconified. A simple modify line does this.
  5695.  
  5696. 'id 0 s 32' to iconify
  5697. 'id 0 s 64' to uniconify
  5698.  
  5699.  The menu now has options to snapshot the window. The windows size and 
  5700. location are read with
  5701.  
  5702. 'id 0 read' the pipe responds with
  5703. 'TOP LEFT WIDTH HEIGHT'   not with 'ok'
  5704.  
  5705.  The information is stored in ENV(ARC): . Before the GUI is opened we check 
  5706. for the information and use it in the window definition line if its 
  5707. available.
  5708.  
  5709.  The about item in the menu now opens a separate GUI. It is a simple window 
  5710. with no gadgets just a label used to display some text. Although the routine 
  5711. used to build the about GUI is trivial it has an interesting ability. It can 
  5712. be made to close automatically after a specific delay.
  5713.  
  5714.  A gui window will close automatically if it tries to read a modify command 
  5715. and you have already closed your end of the pipe. We open the GUI then send a 
  5716. 'tick' modify command to the pipe. This works like 'continue' except the pipe 
  5717. will send back our tick as an event weather the user hits a gadget or not. 
  5718. After sending us the tick event back AWNP tries to read a modify command and 
  5719. THEN discovers we have closed the pipe. If the delay is set as 0 we simply 
  5720. turn modify off and the GUI waits until the close gadget is hit.
  5721.  
  5722.  The data menu items now display information the same way the about requester 
  5723. does.
  5724.  
  5725.  
  5726.  
  5727. ------------------------------------------------------------------------------
  5728.                                 4.5.5 Advanced                                
  5729. ------------------------------------------------------------------------------
  5730.  
  5731.  Tutorial 5 adds new functions, Bubble Help, an arexx host, tooltypes and 
  5732. commodity. Although they are advanced features by now it should be easy for 
  5733. you to follow the logic. They work in very similar ways to the other objects 
  5734. you have learned to deal with. Adding these sort of features to your own 
  5735. GUI's will help make them Quality programs.
  5736.  
  5737.  Before reading this section take a moment and run tutorial 5, knowing what 
  5738. the GUI does will help in understanding the code behind it.
  5739.  
  5740.  Tutorial 5 is only available in Arexx for now, the discussion is kept 
  5741. general and it applies to both 'C' and ARexx.
  5742.  
  5743. TUTORIAL 5
  5744. -----------
  5745.  
  5746.  Most users only scan documentation at best. To allow users to quickly 
  5747. understand your programs Bubble help is very useful.
  5748.  
  5749.  A few simple changes are made in the window definition. It now tells the GUI 
  5750. to send help and window activation events.This is done by adding 'help' and 
  5751. 'state' keywords.
  5752.  
  5753.  A menu option has been added to turn the help bubbles on or off.
  5754.  
  5755.  A change has been made in the main loop, we send 'tick 50' rather than 
  5756. continue when we want to get an event from the pipe. Like continue this ends 
  5757. the modify command part of the conversation and tells the GUI to send us an 
  5758. event. It also forces the GUI to send us a 'tick' event after 50/100 of a 
  5759. second. We use these tick events to delay the displaying of help bubbles.
  5760.  
  5761.  Tick events have other uses, like returning control back to your code after 
  5762. a set delay so it does not wait forever for an event. For now we will just 
  5763. look at the help delay.
  5764.  
  5765.  Each time an event is read in the main loop we check a delay counter. If the 
  5766. counter counts down to 0 we open a help bubble (using some previously stored 
  5767. information). The HELPX and HELPY are used to determine a position for the 
  5768. bubble and MUST be given.
  5769.  
  5770. 'bubble top HELPX left HELPY gt "HELP TEXT"'
  5771.  
  5772.  We also must handle new events, help, arexx, cx and active.
  5773.  
  5774.  We respond to the help event by calling the bubble routine. This routine 
  5775. checks to see if the help event is the same as the last one. If yes we do 
  5776. nothing. If it changed we close the old help window, if we had one, by 
  5777. sending a bubble modify command with no parameters.
  5778.  
  5779. 'bubble'
  5780.  
  5781.  If the event was gadget 0 or -1 we have nothing more to do since they 
  5782. represent the mouse not being over a valid gadget. If the gadget number is 
  5783. valid we store the mouse position that is returned in the help event and the 
  5784. gadget number. We start the delay counter and return.
  5785.  
  5786.  If we receive any activation event, or iconify the gui, we call bubble(0) to 
  5787. close any open bubble help. This needed in case our window becomes inactive 
  5788. due to another window being opened.
  5789.  
  5790.  An arexx host has been added to the GUI. The ARexx host name is 'TUTORIAL5'. 
  5791. This allows a few things.
  5792.  
  5793.  topipe(' arexx gt "TUTORIAL5|age|sex|knowledge|front|quit"')
  5794.  
  5795.  If upon startup the host already exists we know tutorial 5 is already 
  5796. running so the already running gui and brought to front rather than a second 
  5797. occurrence of tutorial 5 being opened.
  5798.  
  5799.  The following arexx commands are supported.
  5800.  
  5801.  front -bring the window to front.
  5802.  quit  -quit tutorial5
  5803.  age [#]  -read or set the age
  5804.  sex [#]  -read or set the sex
  5805.  knowledge [#] -read or set knowledge
  5806.  (See the rxhst: routine)
  5807.  
  5808.  Tutorial 5 is also a commodity.
  5809.  
  5810. topipe('commodity cxname Demo5 cxtitle="AWNPipe demo 5" cxdesc="Disable 
  5811. Enable ignored..." cxhotkey="ctrl alt 5"')
  5812.  
  5813. It supports a hotkey (ctrl alt 5), show or hide the gui, and remove. 
  5814. Enable/disable are ignored as they make no sense in the context of Tutorial 5 
  5815. ...
  5816. (See the commodity: routine)
  5817.  
  5818. TOOLTYPES
  5819.  
  5820.  Tooltype reading is actually not part of the AWNPipe GUI host, its a 
  5821. completely different host inside AWNPipe. Since tooltypes are desirable for 
  5822. almost all programs it has been added to this tutorial. You find the function 
  5823. simple to use.
  5824.  
  5825. Reading tooltypes
  5826.  
  5827.  The tooltypes are read by a function called tooltypes:. First the path to 
  5828. our program is found using 'parse source'. Then a special pipe is opened 
  5829. 'awnpipe:name/xtPATH:PROGRAM'. A line containing the tooltype we wish to 
  5830. check is written to this pipe. If the tool type is found we will read back 
  5831. from the pipe 'ok VALUE' where VALUE is the value associated with the tool 
  5832. type we asked for. If the tooltype is not found we read back a <cr> (empty 
  5833. line).
  5834.  
  5835.  When all the tooltypes have been checked we simply close the pipe connection 
  5836. to the tooltype host.
  5837.  
  5838.  In tutorial5 the windows size/position and bubble help setting are now kept 
  5839. as a tooltype.
  5840.  
  5841. There are also tooltypes to preset the age, knowledge, sex and name. You can 
  5842. force the window to iconify after opening with the iconify tooltype.
  5843.  
  5844. Writing tooltypes
  5845.  
  5846.  
  5847. ------------------------------------------------------------------------------
  5848.                                   4.5.6 Tips                                  
  5849. ------------------------------------------------------------------------------
  5850.  
  5851.  A few quick hints about building and debugging AWNP applications.
  5852.  
  5853. Before writing an AWNP GUI application prototype the GUI with a simple text 
  5854. file (mygui). Use
  5855. 'copy mygui awnpipe:pipename/xcwcon:'
  5856.  
  5857. This speeds up testing of layout changes! Also note you can comment out lines 
  5858. in your file by starting them with ';'. Any line with a semicolon in the 
  5859. first position is ignored.
  5860.  
  5861. --
  5862.  
  5863.  NAME YOUR PIPES !
  5864.  
  5865.  Rather than opening 'awnpipe:/xc' provide a unique name. Use 
  5866. 'awnpipe:PipeName/xc'.
  5867.  
  5868.  A common problem when developing an AWNP application is to find the pipe 
  5869. conversation hangs. Usually this means your program is trying to read data 
  5870. from the pipe, and the pipe is trying to read data from your application. (a 
  5871. read is pending on both ends of the pipe).
  5872.  
  5873.  This can be cleared by issuing a simple shell command.
  5874.  
  5875. 'echo >awnpipe:PipeName/a'
  5876.  
  5877.  Both reads are aborted and AWNP usually notices a problem and exits cleanly.
  5878.  
  5879. --
  5880.  
  5881.  Some times it will be useful to trace the conversation your program has with 
  5882. AWNP. Again this can be done with a simple shell command.
  5883.  
  5884. 'type awnpipe:PipeName/t/i'
  5885.  
  5886.  All data passing either way through the pipe will be output. When your 
  5887. program exits the type command will return. ( this is not limited to to GUI 
  5888. applications. It works for ALL awnp connections!)
  5889.  
  5890.  You can also use
  5891.  
  5892. 'copy awnpipe:PipeName/t/i mylogfile'
  5893.  
  5894.  This saves the conversation to the logfile of course.
  5895.  
  5896.  You can use both at the same time, in fact you can 'twin' the data stream as 
  5897. many times as you like.
  5898.  
  5899.  Some times during testing you might create a GUI with no close gadget, you 
  5900. can usually close ANY GUI with 'control backslash' like you can with a con:.
  5901.  
  5902. --
  5903.  
  5904.  In general you can not assume that you can modify all the parameters you can 
  5905. define for objects. Also in some cases the parameter names or usage may be 
  5906. different in the modify command when compared to the definition line.
  5907.  
  5908. ------------------------------------------------------------------------------
  5909.                                    5 Demos                                    
  5910. ------------------------------------------------------------------------------
  5911.  
  5912.  Several GUIs of example gadgets can be viewed by running the Gadgets# in the 
  5913. demos drawer inside AWNP-Docs. To generate these GUIs a simple text file is 
  5914. being copied to a GUI generating pipe. The 'wcon:300//200/200/PipeEvents' at 
  5915. the end of the pipe name simply sends the output of the pipe to a con so you 
  5916. can see what is going on.
  5917.  
  5918.  Some example scripts using pipe generated GUIs are also in the demo drawer. 
  5919. These demos are mostly ARexx or ADOS scripts. Load them in your text editor 
  5920. and take a look at them. I think you will find they are very simple script 
  5921. considering the powerful GUIs they create. Reading the comments in the 
  5922. scripts should help you when learning to build and operate your own AWNPipe 
  5923. GUIs.
  5924.  
  5925. ---
  5926.  
  5927.  CAList is an ADOS script. It is graphical wrapper for the standard list 
  5928. command. It is a VERY simple script. Put it in 'C:' with its script bit set 
  5929. if you like it enough to make regular use of it. Use 'calist ?' to get a 
  5930. usage display.
  5931.  
  5932.  This script gives a good example of how to build a simple gui. It shows how 
  5933. much can be accomplished  in a short script.
  5934.  
  5935. ---
  5936.  
  5937.  Form is an ADOS script that displays a form. Use 'execute Form' or set the 
  5938. script bit for the file and simply type 'form'.
  5939.  
  5940.  This gui is truly interactive and requires the name to be set before the 
  5941. form is accepted. It allows resting of the form and knows when the user 
  5942. aborts.Its rather extreme for an ADOS script but is included to show you just 
  5943. how much can be accomplished with ADOS and AWNPipe working together. ADOS 
  5944. wizards may find the handling of the event file and environment variables 
  5945. interesting.
  5946.  
  5947. ---
  5948.  
  5949.  Fonttoy is an ADOS script to play with fonts. Use 'execute FontToy' or set 
  5950. the script bit for the file and simply type 'fonttoy'.
  5951.  
  5952.  This script creates a very simple gui. However it uses gadget 
  5953. interconnection to do some magic that only experienced GUI developers are 
  5954. likely to understand. It also uses numerical tag values, you will likely 
  5955. never do this. Note that numerical tags CAN be used with defining AWNPipe 
  5956. GUIs and this means you will be able to access new CA/Reaction features as 
  5957. they come out without changes to AWNPipe.
  5958.  
  5959. ---
  5960.  
  5961.  Dict-thesar.rx is an arexx script. It is run from its icon or shell. words 
  5962. are search in the Merriam Webster site so you must be online. The menu will 
  5963. start and control miami if you have it installed. Bubble help is provided and 
  5964. it is simple to use so no real docs are needed.
  5965.  
  5966. You should find this tool useful enough to keep installed on your system.
  5967.  
  5968. ---
  5969.  
  5970.  xo.rx is an arexx script. Use 'rx xo.rx' to run it. You must 'cd' into the 
  5971. demo drawer first so it can find its image file (xo.gif). It does not play 
  5972. against you so you must  play both sides of the game. (click in the squares).
  5973.  
  5974.  It changes the button images in a operating GUI. It shows how to create 
  5975. multiple images from a single source image. It also lets you see how to 
  5976. modify a gui after it has been opened. An additional gadget is even added to 
  5977. the GUI after it has been opened. Take a look at xo.gif in an image viewer, 
  5978. you may be surprised to see how small the image is.
  5979.  
  5980.  
  5981. ---
  5982.  
  5983.  DropBox.rx can be run from its icon or by typing 'rx dropbox.rx' in a shell. 
  5984. Looking at the tooltypes of Drop box should help you understand what is going 
  5985. on. You set tooltypes to tell the program what to do with files or drawers 
  5986. that are dropped on it. I hope it is something you will keep around and be 
  5987. able to make use of. With a little modification it could be very powerful 
  5988. indeed.
  5989.  
  5990.  The gui is so simple it almost unbelievable, however it is an app window. 
  5991. That makes it very special. The script also makes heavy use of AWNPipes 
  5992. ability to do pattern matching. Finally the script will also teach you how to 
  5993. read tooltypes using AWNPipe.
  5994.  
  5995. Possible tool types.
  5996.  
  5997. pat (pattern)=YourCommandText
  5998.  
  5999. This tells dropbox  to execute your command for any files that match the 
  6000. pattern you have set. '%f' in the command is replaced by the name of the file 
  6001. that was dropped on dropbox.
  6002.  
  6003. pat (pattern)=drawer
  6004.  
  6005. Tells DropBox to use its default drawer handling for that pattern.
  6006.  
  6007. pat (pattern)=image
  6008.  
  6009. Tells DropBox to use its default image handling for that pattern.
  6010.  
  6011. pat (pattern)=text
  6012.  
  6013. Tells DropBox to use its default text handling for that pattern.
  6014.  
  6015. bin BinaryPattern=YourCommandText
  6016.  
  6017. This tells dropbox  to execute your command for any files whose first 12 
  6018. bytes match the binarypattern you have set. '?' is the only wildcard allowed 
  6019. in the BinaryPattern. '%f' in the command is replaced by the name of the file 
  6020. that was dropped on dropbox. iconify
  6021.  
  6022. A tooltype of 'iconify' tells DropBox to iconify itself as soon as it is run. 
  6023. You can still drop files on the iconified window to have dropbox process 
  6024. them.
  6025.  
  6026. multi
  6027.  
  6028. A tooltype of 'multi' tells DropBox to allow files dropped on it to have more 
  6029. than one command run for them. The default is for dropbox only to only 
  6030. respond once to each file dropped.
  6031.  
  6032. ---
  6033.  
  6034.  The first real projects to use AWNPipe GUIs were some aweb utilities.
  6035.  
  6036. CacheControl.awebrx allows you to micro manage AWebs caching of websites.
  6037.  
  6038. Put the script and CacheControl_doc.html in AWeb3:plugins, it may be called 
  6039. directly from the ARexx menu or from an AWeb button.
  6040.  
  6041. GUI Button
  6042. name            CCtrl
  6043. command         run awebpath:plugins/cachecontrol.awebrx
  6044.  
  6045. ARexx Menu
  6046. title           CacheControl
  6047. macro           awebpath:plugins/cachecontrol.awebrx
  6048.  
  6049. ---
  6050.  
  6051. AWebModes.awebrx allows you to easily control many of AWebs settings. 
  6052. Gabriele Favrin has kindly allowed a version of it to be included here. Put 
  6053. the script and AWebModes_Doc.html in AWeb3:plugins, it may be called directly 
  6054. from the ARexx menu or from an AWeb button.
  6055.  
  6056. GUI Button
  6057. name            Modes
  6058. command         run awebpath:plugins/AwebModes.awebrx
  6059.  
  6060. ARexx Menu
  6061. title           AWebModes
  6062. macro           awebpath:plugins/AWebModes.awebrx
  6063.  
  6064. ---
  6065.  
  6066. DropZone.awebrx opens an appwindow on WB so you can drag and drop files to be 
  6067. displayed in AWeb, even while aweb is on its own screen. Put the script and 
  6068. DropZone_Doc.html in AWeb3:plugins. It may be called directly from the ARexx 
  6069. menu or from an AWeb button.
  6070.  
  6071. GUI Button
  6072. name            DZone
  6073. command         run awebpath:plugins/DropZone.awebrx
  6074.  
  6075. ARexx Menu
  6076. title           ChangeModes
  6077. macro           awebpath:plugins/DropZone.awebrx
  6078.  
  6079.